getting started with cron

getting started with cron

Posted by: gabe
Posted on: 2002-09-25 14:49:00

I followed the steps on this page to create a simple script that would write the time to a file. I am able to run the script manually just fine.

I then created a cronjob to test out this script:

50,1 * * * * /home/USER/scripts/cron-test.pl

I then added it to my crontab and it does not work. Rather than appending the time to the test file, I receive an email with this error in the body:

/bin/sh: /home/USER/scripts/cron-test.pl: Permission denied

(Where USER, of course, is my username.)

What am I doing wrong here?

Thanks,
Gabe



Re: getting started with cron

Posted by: wil
Posted on: 2002-09-25 15:19:00

I'm not sure, but this could be to do with the permissions on the Perl file in question? Have you tried CHMODing it to something else? Make sure that group and others are able to execute the script, not only you. If you have set permissions on the script so that only you can excecute it, this would explain why it works when you try and execute it yourself but not when cron tries to run it.

- wil

Re: getting started with cron

Posted by: will
Posted on: 2002-09-25 15:30:00

chmod +x /home/USER/scripts/cron-test.pl

Re: getting started with cron

Posted by: gabe
Posted on: 2002-09-25 15:31:00

That did the trick! Thanks, Wil and Will!

Tags: cronemailscriptscrontabgabe