Skip to content

Crontab

Test a cronjob

eval "$(crontab -l | sed -n '5p' | tr -s ' ' | cut -d' ' -f 6-)"
crontab -l

Template for cronie

##########################################################################
###
#### - wuseman help
#### -------------------------------------------------------------------
#### * * * * * command to be executed
#### - - - - -
#### | | | | |
#### | | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
#### | | | ------- Month (1 - 12)
#### | | --------- Day of month (1 - 31)
#### | ----------- Hour (0 - 23)
#### ------------- Minute (0 - 59)
###
##########################################################################
###
####  Special string     Meaning
#### --------------------------------------------------------------------
####  @reboot    Run once, at startup
####  @yearly    Run once a year, “0 0 1 1 *”.
####  @annually  (same as @yearly)
####  @monthly   Run once a month, “0 0 1 * *”.
####  @weekly    Run once a week, “0 0 * * 0”.
####  @daily     Run once a day, “0 0 * * *”.
####  @midnight  (same as @daily)
####  @hourly    Run once an hour, “0 * * * *”.
###
##########################################################################
MAILTO="some-mail@adress.co"

##########################################################################
###
#### - Disable email output for everyone
###
#### 0 3 * * * /root/backup.sh >/dev/null 2>&1
###
##########################################################################

##########################################################################
###
####  To mail output to particular email account, lets say wuseman@nr1.nu 
####  you need to define MAILTO variable as follows:
#### --------------------------------------------------------------------
####  MAILTO="some-mail@adress.com
####  0 3 * * * /root/backup.sh >/dev/null 2>&1
###
##########################################################################