Cron Help Needed


#1

Greetings all,
Since I’m a raw beginner at this particular subject, I figured this was the place to start :slight_smile:

I’m attempting to set up a cron file in order to run a particular script at 4:59am each day. I’ve manually tested the script I want the cron file to execute and it’s running fine. However, the cron file isn’t executing it.

This is what I have in the cron file:

59 04 * * * /usr/local/bin/perl /home/“username”/“domain”/updatesaints/update.pl ;

Obviously I’ve done something wrong and would greatly appreciate some help (preferably in words of one syllable)

With blessings,
Dal


#2

You may like to peruse the DreamWiki page http://wiki.dreamhost.com/index.php/Cron which should make things clear.

There appears to be a speck of fly dust at the end of your line which you might want to brush away.

Are you using SSH and crontab -e to insert the line or some other technique?


Norm

Opinions are my own views and are not the views of DreamHost.
Any advice offered by me should be acted upon only at your own risk.


#3

“Fly dirt” now brushed away. And yes, I was using Putty and crontab -e


#4

Is your .pl file executable at 755?
Oh and does it run from the command line? (Your perl program line that is)


Norm

Opinions are my own views and are not the views of DreamHost.
Any advice offered by me should be acted upon only at your own risk.


#5

I think I may have found the problem. One of the files was pointing to the wrong directory… which wouldn’t help at all sigh

er… just how do you run it from the command line? (total newbie here when it comes to this)


#6

You just do it like cron does it.

/usr/local/bin/perl /home/“username”/“domain”/updatesaints/update.pl

From the command line when you have SSH’d in.

It may offer you some useful errors.

With your crontab -e editing you can place

MAILTO="username@example.com"

at the top and that email address will get all the error messages instead of root.


Norm

Opinions are my own views and are not the views of DreamHost.
Any advice offered by me should be acted upon only at your own risk.