Print View

Scheduling Tasks
Updated: 11/01/2003


General Information

Cron is the *nix program that runs scheduled tasks that are read from /etc/crontab.  This guide will teach you how to make a scheduled process by using cron.

Requirements

  1. Possible root access

Configuration

Adding a task for cron to do is rather simple.  Just edit the crontab with our task.
# crontab -u root -e
The -u flag tells crontab to tweak the following user's crontab and the -e flag tells crontab to edit the file.

For this example, we will follow the format and update our ports tree every morning at 3am.
#minute hour    mday    month   wday    command with full path
0       3       *       *       *       /usr/sbin/cvsup -g -L2 /etc/cvsupfile
Save and exit.  Now your ports tree will be updated every morning.


Author: Jon LaBass
jon at bsdguides dot org

Find this guide useful?
Support the author:


2 Comments

Posted by giovanni on July 05, 2004 at 11:41:37 am PDT

If you want a task run at every 5 something, you can use */5. In the following a task is run every 5 minutes.

#minute hour    mday    month   wday    command with full path
*/5       3       *       *       *       <task>


Posted by thekore on July 05, 2004 at 11:41:37 am PDT

well i just tried it...

0           1          *           *          *          /bin/yasuc


lets hope it works


Copyright 2003 - 2012 BSD Guides.  All rights reserved.

About | Terms of Use | Privacy | Contact