Cannot capture streaming with cron
Gang -
Please help mitigate my ignorance re/ cron.
I want to record a webcast with a cron job.
I have the scripts working, but not with cron.
Here's the start script:
mpg123 -b 1024 -s (url goes here) > /home/mydirectory/audio/GDH.pcm
This works like a charm when I invoke the script from the command line.
The file "GDH.pcm" appears, and starts filling up.
Similarly the stop script:
mpg_pid=$(/sbin/pidof mpg123)
echo $mpg_pid
kill $mpg_pid
When invoked, it dutifully echoes the PIDs and kills any mpg123 job(s).
But when I set up "start" to run at a specified time (or launch manually) with kcron, I just get a zero-length file.
The "stop" script does nothing when invoked by kcron.
Permissions for both scripts are 104755.
I am owner and group for "start". Root for "stop", so it can run "pidof."
I don't see anything in /var/log/messages to indicate what the problem is.
For some reason, cron just can't seem to redirect mpg123's output (though it can create the file) and can't kill the jobs.
I know it's something simple, but I've been tinkering off and on for weeks with no success.
Any ideas?
Thanks!
|