[MPlayer-users] recording radio with cron

Kevin Sookocheff kbs464 at mail.usask.ca
Fri Jun 24 02:45:59 CEST 2005


Hey everyone,

	I apologise if this topic has been covered before but I've searched through 
the archives and haven't hit pay-dirt yet.  Anyways, I'm trying to schedule 
mplayer to record internet radio at a specific time using cron.  The script 
I've written works wonderfully when I run it myself but when cron runs it 
nothing happens.  Here is the script:

#!/bin/bash

# I've tried this with and without quotes
stream="$1" 
outfile=$2
length=$3

mplayer -noconsolecontrols -dumpaudio -dumpfile ${outfile} ${stream} 
< /dev/null > /dev/null 2>&1 &

/bin/sleep ${length}
/bin/kill -2 $!

and here is the crontab
40 18 * * 1-5 $HOME/scripts/streamRec.sh http://64.236.34.196:80/stream/8016 
$HOME/Radio/MBE/MBE_`date +%b_%d_%y`.mp3 300

Like I said earlier, if I run 
$HOME/scripts/streamRec.sh http://64.236.34.196:80/stream/8016 
$HOME/Radio/MBE/MBE_`date +%b_%d_%y`.mp3 300

by itself everything works but when the timer hits and cron runs the script I 
get nothing.

Thanks for your time,
Kevin




More information about the MPlayer-users mailing list