Debugging cron
Say you setup this cron job to run your ruby script every 5 minutes:
*/5 * * * * ruby /home/ubuntu/seatcheck/seatcheck.rb
But you're checking your logs and it doesn't seem to be running....??? A good way to debug is to comment out your entry and add:
* * * * * env > /tmp/env.output
Then check the convents of env.output and then compare that to what you get when you run env
in your shell.
Volla, and you're sure to see that cron doesn't have the same path as you do -- so no ruby runtime.
A quick fix:
*/5 * * * * /usr/local/bin/ruby /home/ubuntu/seatcheck/seatcheck.rb
Written by Alex Egg
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#