Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.