hello phpgeeks, I have created a php file which i want to run in the background even if my site is not used by any1. How to add this file in cron job using c-panel of linux hosting.
| |
|
Welcome to KnowledgeSutra - Dear Guest | |
1 reply to this topic
#2
Posted 28 December 2011 - 10:19 AM
Go to CPanel of your hosting and in the menu Advanced you can see a section called Cron jobs, push on it.
Set when you want it to work, the period of time, by common settings you will understand how it works. The command run by the cron job must be a valid command.
So here are some methods which could work:
wget -O /dev/null http://www.yoursitename.com/cron.php >/dev/null
GET http://www.example.com/cron.php > /dev/null
or just put the document root path to file and it should work as you may not have the permissions to run some commands:
/home/YOURUSER/public_html/cron.php
Set when you want it to work, the period of time, by common settings you will understand how it works. The command run by the cron job must be a valid command.
So here are some methods which could work:
wget -O /dev/null http://www.yoursitename.com/cron.php >/dev/null
GET http://www.example.com/cron.php > /dev/null
or just put the document root path to file and it should work as you may not have the permissions to run some commands:
/home/YOURUSER/public_html/cron.php
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users













