BSD Guides :: Doing Stuff With FreeBSD, NetBSD, OpenBSD, & Mac OS X

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: