This is the built-in automation tool for users of OpenBSD to set up task scheduling. Each user can have a separate crontab that holds several cronjobs to be executed periodically by a cron daemon. Synopsis:
# Backup table mytable and every Saturday 9:30am
30 9 * * 6 /usr/bin/perl /path/to/scripts/backup.pl
To edit a cronjob, do:
$crontab -l > temp.txt --> write current cronjob to file
$pico temp.txt (or use nano, of vi) --> make changes
$crontab temp.txt --> install back the job
Alternate way:
$export EDITOR=/path/to/pico (or nano, vi is default)
$crontab -e -->edit and save new jobs
Important: Cron has a different set of environmental variable settings from that of the user's. For example, the user's $PATH setting might have /sbin:/usr/sbin:/usr/local/sbin, but cron's $PATH might not. Sometimes extra environmental settings are required for a job to run inside cron. To make these setting, simply edit the cron, and add the neccessary settings on top of file (ex. add PATH=$PATH:/sbin:/usr/sbin)
Note: should a cronjob produce any error message, this message will be mailed to the owner of that cronjob. Simply type æmailÆ to open the email folder and view the cron daemon mail.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.