Cron

System-wide Cron Configuration
Example configuration: 15    8   * * *    root  rm -f /var/spool/cron/lastrun/cron.daily 0     8   * * wed  root  rm -f /var/spool/cron/lastrun/cron.weekly 30    8   1 * *    root  rm -f /var/spool/cron/lastrun/cron.monthly */10  *   * * *    root  test -x /usr/sbin/run-crons && /usr/sbin/run-crons Restart cron daemon:
 * 1) vim /etc/crontab
 * 1) 0    *   * * *    root  rm -f /var/spool/cron/lastrun/cron.hourly  <- do not run every hour
 * 1) /etc/init.d/vixie-cron restart

User Cron Configuration
Add user to 'cron' group gpasswd -a username cron Use the following commands crontab -e          <- edit schedule for current user crontab my-crontab  <- replace entire schedule for current user crontab -l          <- list schedule crontab -r          <- remove schedule for current user crontab entry syntax minute hour dayOfMonth month dayOfWeek command example - at 5:00 run 'stuff' 0    5     *     *     *    stuff

Cron and Ruby
To use a custom RUBYLIB, include the variable in crontab. RUBYLIB=/root/rubylib/ 0 12 *   *   *  ruby /path/to/script.rb
 * 1) m h  dom mon dow command

Output From Vixie-Cron
stdout and stderr from the scripts in cron.* goes in a mail to root