Thursday, November 20, 2014

cron debugging: cat /var/log/syslog

So I wanted to test a cron job and make sure that it was running.  I decided to make it something obvious, so I made my command

/usr/bin/firefox www.google.com

and told it to run every minute.  And I got nothing.  After restarting cron and making sure that the last line in crontab had a newline and everything I could think of, I finally looked at the syslog and learned that it was running.  It just didn't output anywhere I could see it.

So here's another case where it's worth looking at syslog:

cat /var/log/syslog

The cron output isn't visible unless you direct it to a file that you choose and look at that file.

No comments:

Post a Comment