SolveITProblems is a project of intellectual club

SolveITProblems это проект интеллектуального клуба

четверг, 7 октября 2010 г.

Cron Job to Run PHP Script

What you gonna do if you have some temporary folders on your hosting... Time after time you need to delete them. I have such a problem and i've heard about Cron jobs somewhere. So, the following steps can help you to do really useful things via php and Cron.

1) Create a php file which you want to run time after time... or every minute :)
2) Go to Cpanel, select the Cron jobs, you'll see the image which is shown at the top :) . You select the frequency and add the following code:

/usr/bin/wget http://www.path-to-your-script/script-name.php >/dev/null

Click "Add New Cron job" and you can feel yourself happy :)

You can add your email address and each time the Cron Job will finish, you'llbe reminded about that. You'll see if its failed too...

Its Simple, and its Working :)

Комментариев нет:

Отправить комментарий