Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Saturday, March 29, 2008

Cron Update

Regular readers may remember that I've been trying to automate the checking of podcasts using Armangil's Podcatcher. Back in November, I wrote this post explaining my frustration. A comment from my riding buddy Steve gave me some good things to try, which helped me get the script going. Unfortunately, no progress was made on the cron front.

Here's what gets me. The command, or a script containing the command, works fine from the command line. The job takes several minutes just to check all of the feeds I watch, plus additional time for any downloads. I can see the ruby interpreter chewing up CPU in the top display. However, when I put either the command or script in cron, ruby runs just for a second.

I'm wondering if there is a file permission or visibility issue. Both seem to run under my user - not as root. Unfortunately, ruby doesn't tell me why it gives up so quickly.

I checked the syslog, but there are no entries from ruby - just the line from cron saying that it's starting the task. Is there another log where I can find more detail, or can I ask ruby to be more open with its issues?

In the meantime, I'll keep running the script from a command line every day or so.

Labels: ,

1 Comments:

At 6:48 PM, Blogger steve said...

To get full information of what's getting logged, I usually put the following line in /etc/syslog.conf:

*.* /var/log/everything.log

Then restart syslogd and you can tail -f /var/log/everything.log.

The only other think I can think of is ruby is for some reason expecting to have stdin available, which won't happen under cron. One workaround is to call the script in cron with nohup, for example:

*/5 * * * nohup /home/dan/somescript.rb

 

Post a Comment

<< Home