My server has not been running cron jobs since March 25, though it was running before that day and nothing has changed.
The OS version is Ubuntu 8.04LTS.
First, I restarted cron
and checked processes.
$ sudo /etc/init.d/cron restart
* Restarting periodic command scheduler crond
...done
$ ps aux | grep cron
root 14893 0.0 0.0 19640 908 ? Ss 14:50 0:00 /usr/sbin/cron
user 16144 0.0 0.0 4972 844 pts/0 R+ 14:50 0:00 grep cron
$ pgrep cron
14893
It seems that the cron
process is running but when I checked status:
$ /etc/init.d/cron status
* Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}
I guess there's something wrong.
I checked syslog
$ less /var/log/syslog | grep CRON
Mar 25 07:50:01 mail /USR/SBIN/CRON[12406]: (user) CMD (/home/user/public_html/rails_app/current/script/runner -e production "NewsRelease.send_unnoticed_mails" >> /home/user/public_html/rails_app/current/log/cron.log 2>&1)
Mar 25 07:50:01 mail /USR/SBIN/CRON[12409]: (user) CMD (/home/user/public_html/rails_app/current/script/runner -e production "Link.send_unnoticed_mails" >> /home/user/public_html/rails_app/current/log/cron.log 2>&1)
Apr 7 11:47:19 mail /usr/sbin/cron[13954]: (CRON) INFO (pidfile fd = 3)
Apr 7 11:47:19 mail /usr/sbin/cron[13955]: (CRON) STARTUP (fork ok)
Apr 7 11:47:19 mail /usr/sbin/cron[13955]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
The logs after Apr 7 are logs when I run commands for cron
manually.
Therefore cron has not been running since Mar 25.
My crontab file is below. It is to execute rails and ruby methods. These jobs were running successfully before March 25.
# Begin Whenever generated tasks for: rails_app
PATH=/usr/loca/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
50 7 * * * /home/user/public_html/rails_app/current/script/runner -e production "Link.send_unnoticed_mails" >> /home/user/public_html/rails_app/current/log/cron.log 2>&1
0 5 * * * /home/user/mysql_backup.sh >> /home/user/public_html/rails_app/current/log/cron.log 2>&1
0,15,30,45 * * * * /home/user/public_html/rails_app/current/script/runner -e production "Tweet.post_tweet_at" >> /home/user/public_html/rails_app/current/log/cron.log 2>&1
# End Whenever generated tasks for: rails_app