Web Hosting Talk







View Full Version : Crontab Setup


cyrusTvirus
02-14-2002, 06:28 PM
Hi,

I want to run a script every 5 minutes every day.
I created the following entry in the crontab

0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /home/sites/www.XXXX.com/web/netstatus/cron_script
(this is infact one line in the tab)

What am I doing wrong here cause now the script isn't ran somehow. This is how I understand the way to create it searching google.

Feedback very welcome !

Robbert

Pingu
02-14-2002, 07:37 PM
Err, what's "root" supposed to do???

cyrusTvirus
02-14-2002, 07:45 PM
I tried to run the script as root......

Pingu
02-14-2002, 08:06 PM
Might be mistaking, but crontab's are set under each user's own account. If you set up a cron job as root, it will run as root. If you set up a job as otheruser, then it will run as otheruser.

Pingu
02-14-2002, 08:09 PM
Oh, here's a link to a very simple, but very clear page:
http://weather.ou.edu/~billston/crontab/

cyrusTvirus
02-15-2002, 10:57 AM
An even stranger problem occurs now.

We removed the crontab, shut down cron and restared it. But the cron keeps running and we are definitely sure that there is nothing running anymore pointing to the desired crontab.

Is there some command for which I can see from where the crontab run is initiated ?

ps -aux no lights
pstree doesn't help me out either nothing shows up.....

Robbert

Pingu
02-15-2002, 03:00 PM
Check under both the root and admin account:
crontab -l

That will show you a list of all jobs for that user, if any.

If not there, maybe it's hiding in one of the /etc/cron.whatever ???

If nothing helps and you're sure it's nowhere to be found, do the typical helpdesk answer:
reboot the server :D