LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Radio record with cronjob (https://www.linuxquestions.org/questions/linux-newbie-8/radio-record-with-cronjob-4175599026/)

XAntares 02-05-2017 03:16 AM

Radio record with cronjob
 
Hi,

I like to record a radio stream with cronjob (with linux mint).

This should be every sunday from 10am to 01pm.

I had create a sh-file with at:

Code:

echo 'Kommando' | at 09:55
streamripper http://sunshinelive.hoerradar.de/sunshinelive-live-mp3-hq -a /home/madand/Musik/$(date +%x_%X).mp3 -l 11400

But there is no mp3 file visible on home/madand/musik

Turbocapitalist 02-05-2017 03:32 AM

cron has a different environment than your regular shell and PATH is one of the variables that is different. So your script should either explicitly set the contents of PATH early on or else each program, such as streamripper, need to use their full path.

michaelk 02-05-2017 06:34 AM

At and cron are not the same. For a cron job to run every Sun would be

55 09 * * sun /path/to/my-script

my-script

streamripper http://sunshinelive.hoerradar.de/sun...ve-live-mp3-hq -a /home/madand/Musik/$(date +%x_%X).mp3 -l 11400

To create the job run crontab -e which typically runs vim. You can find lots of examples on using vim and creating cron jobs.

See man crontab for help.

XAntares 05-04-2017 10:40 AM

many thanks for your reply.

I hope, this will work with vim.

Greetings XAntares


All times are GMT -5. The time now is 06:48 PM.