30 19 * * * root shutdown -h now


  1. Minute [0,59]
  2. Hour [0,23]
  3. Day of the month [1,31]
  4. Month of the year [1,12]
  5. Day of the week ([0,6] with 0=Sunday)


You can define environment variables in the crontab itself when running crontab -e from the command line.

# m h  dom mon dow   command
* * * * * sleep 5s && echo "yo"

This feature is only available to certain implementations of cron. Ubuntu and Debian currently use vixie-cron which allows these to be declared in the crontab file (also GNU mcron).

Note that you can't use variable substitution as in shell, so a declaration like PATH=/usr/local/bin:$PATH is interpreted literally and does not work as expected.

Archlinux and RedHat use cronie which does not allow environment variables to be declared and will throw syntax errors in the cron.log. Workaround can be done per-entry:

# m h  dom mon dow   command
* * * * * export LC_ALL=nb_NO.UTF-8; sleep 5s && echo "yo"


grep CRON /var/log/syslog

Feb 15 12:00:01 istest CRON[58699]: (root) CMD (/root/files/scripts/
Feb 16 00:30:01 istest CRON[100269]: (root) CMD (/root/files/scripts/

Last update: 2023-02-16 12:58:30 UTC