_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

crontabconfig and usage.

-e : edit
-l : list

This applies to the user crontab, the system crontab is /etc/crontab.

back to top

MINUTE HOUR DAY_OF_MONTH MONTH DAY_OF_WEEK COMMAND
The fields MINUTE, HOUR, DAY, MONTH, DAY_OF_WEEK can have the following values:

15 5-10 * * 1 5 date > log

This will output date to the file log Monday through Friday 15 minutes after the hour between 5am and 10am any day of the month all months.

back to top

To ensure crontab can execute the command, use the full path of the command, which can be found using the command whereis , and full path for files and directories.

$ whereis date
OpenBSD output : /bin/date
linux output : date: /usr/bin/date /bin/date /usr/man/man1/date.1.gz
15 5-10 * * 1 5 /usr/bin/date > /home/user/log

Some environment variables may not be found, environment variables can be set at the beginning of the crontab file. Example:

HOME=/home/user
15 5-10 * * 1 5 /usr/bin/date > ${HOME}/log

back to top

linux , command_line_intro , command_line , bash

- OpenBSD manpages: crontab(1) , crontab(5)

back to top

ohazot | about | ohazot.com <admin@ohazot.com>

This document applies to: OpenBSD 7.8 , linux | Created:2026-03-27|Updated:2026-03-27|