Cron cheat sheet

List all users and their cron jobs

for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done

Restart cron

/etc/init.d/ cron restart

Find running / clashing cron processes

ps aux | grep $(cat /var/run/crond.pid)

Kill cron process

kill -9 $(cat /var/run/crond.pid)

Add cron  run

crontab -e

add to the bottom to add job for WordPress each minute (Stop email notification add “MAILTO=”” to top)

*/1 * * * * curl -I http://example.org/wp-cron.php?doing_wp_cron

Read mail (confirm cron jobs running)

cat /var/spool/mail/root

Delete mail tail

> /var/mail/username

cron times
@hourly or 0 * * * *
@daily or 0 0 * * *
@weekly or 0 0 * * 0
@monthly or 0 0 1 * *
@yearly or 0 0 1 1 *
and of course @reboot

CISSP CISM PMP