Jump to content

Cron Jobs - Need some help!


Thauwa

Recommended Posts

Hello all!

I have a big problem with executing cron jobs. I really need to know how to execute a php file every day at five minute intervals or so. The time factor is essential for me, that's why I can't use some free cron job providers (well, if you do have any suggestions, please do post them (and I don't want to pay! :) )).

Anyway, I still want to know how and why they work, and how I could implement this in my own host's server. I only need simple answers, so don't get all bothered-up trying to answer any complex questions :) ! I hope that I could get a suitable explanation..

Thanks you!

Link to comment
https://forums.phpfreaks.com/topic/180130-cron-jobs-need-some-help/
Share on other sites

you should be able to schedule CRON jobs through some control panel that your host provides. If you can't find it I suggest you contact your host about it. Surely they will be able to help you.

 

http://clickmojo.com/code/cron-tutorial.html

 

they even have something that shows you how to schedule a tast every 5 minutes

I recently did some research on this, and here is what I use:

0 3 * * * 1,2,3,4,5,6 /usr/bin/php /var/www/test.php

 

That will run every day at 3am.  Change the 0 to a */5, and the 3 to a * to run it every 5 minutes.  /usr/bin/php is the path to php and /var/www/test.php is the path to your file.  Your paths may be different.

Thanks all, but I've got a problem (assume that I didn't contact my host yet :) ), but where should I insert the coding akl_ and mike posted?

P.S; I now contact my host :)

 

Cron jobs like the one atl_andy posted are configured by editing your crontab file if you have shell access or as mikesta707 said, some hosts provide a web interface. Your question is not at all php related.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.