Click to See Complete Forum and Search --> : Setting up a crontab


PhatBarren
10-27-2001, 05:10 PM
Hi.
I have ceated a web application for which i'd like to set a crontab to execute a certain php script every hour. I don't know how to set these, and I have to do it remotely, over ssh or telnet, etc..
let's say the script i want to execute is located in htdocs/myapp/MyCronnedScript.php and like i said, i want to execute it every hour on the hour. How do I do this?

Thanks!

X_console
10-27-2001, 07:54 PM
0 * * * * /whatever/program

References:
man crontab http://it.yorku.ca/moonfrog/tutorials/scheduling.html

PhatBarren
10-28-2001, 11:48 AM
thanks for the link.
I get an error message when I try to start the crond service:

[root@localhost phat]# /sbin/service crond start
Starting crond: crond: can't lock /var/run/crond.pid, otherpid may be 876: Resource temporarily unavailable
[FAILED]
[root@localhost phat]#

anyone know what this means and how to deal with it??

bdl
10-28-2001, 12:04 PM
Originally posted by PhatBarren:
<STRONG>
I get an error message when I try to start the crond service:

[root@localhost phat]# /sbin/service crond start
Starting crond: crond: can't lock /var/run/crond.pid, otherpid may be 876: Resource temporarily unavailable
[FAILED]
[root@localhost phat]#

anyone know what this means and how to deal with it??</STRONG>

I'd guess that it's trying to start a second occurance of crond up and failing; why are you starting it by hand, it should be started in the system init at some point. Once you edit your crontab the cron daemon will automatically add in the newly edited file and start using it. You don't need to manually start crond nor do you have to 'restart' it by issuing a hangup or killing the process. Luck!