Linux Cron

List all cron jobs

crontab -l <user>

the superuser may specify a different username than their own

Change the editor when updating crontab

env EDITOR=nano crontab -e 

 

Output cron log to a file

big-long-cron-command >> ~/cron.log 2>&1

Examples

0/30 * * * * jobname    => Every 30 minutes, run jobname

Format

 +---------------- minute (0 - 59)
 |  +------------- hour (0 - 23)
 |  |  +---------- day of month (1 - 31)
 |  |  |  +------- month (1 - 12)
 |  |  |  |  +---- day of week (0 - 6) (Sunday=0)
 |  |  |  |  |
 *  *  *  *  *

 


CentOS - stop/start/restart CRON

service crond [stop|start|restart]

CentOS 7 

systemctl [stop|start|restart] crond

Ubuntu

service cron [stop|start|restart]