Cronjob not working

1

I've got a simple crontab for ripping my local radio station only when I want:

0 16 * * 0 /root/streamripper.sh
0 17 * * 0 killall streamripper
0 20 * * 0 /root/streamripper.sh
0 21 * * 0 killall streamripper

and it's not working. Also, this is the content of streamripper.sh:

#!/bin/sh
streamripper http://some.radio.com/stream.aac -s -o never -d /some/secret/directory

Thanks :)

Silke

Posted 2010-09-01T16:02:11.643

Reputation:

Answers

2

Is streamripper.sh executable (chmod +x /root/streamripper.sh)? Is the streamripper binary in the path? Try to give a full path to it in the script (you get the full path with which streamripper).

Sven

Posted 2010-09-01T16:02:11.643

Reputation: 1 591

2

Worth checking to see if the cron is actually being run - see if the contents of /var/log/cron tie to the expected execution times. Also, is there really any need to mention that the script is probably doing something illegal? -1 for trying to bring down the integrity of this site.

James L

Posted 2010-09-01T16:02:11.643

Reputation: 151

1

If you want to run as root, then u have to write it like this:

0 16 * * 0 root /root/streamripper.sh

U need to tell cron the user root so it can properly work

Also make sure the script has the proper rights, so root can execute it, u can check out the right by typing the following command:

ls -l /some/path/to/script/

and it should look like this to be executable:

-rwx-r--r--

What i highlighted that is what needs to be there.

If the letter x is missing then u should write the following command line:

sudo chmod u+x /some/path/to/script/name_of_script

Emese Máthé

Posted 2010-09-01T16:02:11.643

Reputation: 9

1

Are you receiving any error emails? I'd set MAILTO=some_use_you_read_mail_for and see if there are any obvious errors.

and you don't quite define 'not working'

Rich Homolka

Posted 2010-09-01T16:02:11.643

Reputation: 27 121

0

And it makes really no sense to run streamripper as the user root. Better use any unprivilegued user for that. For example your own.

Jan.

Posted 2010-09-01T16:02:11.643

Reputation: 431