|
|
#1 (permalink) |
|
Registered User
Seasoned Poster
Joined in Feb 2008
Lives in Kingdom Of Saudi Arabia
Hosted on i have my own server :)
35 posts
Gave thanks: 1
Thanked 3 times
|
how can i make php files run in cron jobs?
Hi all
i wrote this code to delete all files that last accessed was after 1 hour .. it works great if i run the file manually from the browser but it doesn't if i use cron jobs ! i don't know if there is some rules or something .. PHP Code:
thx all ![]() |
|
|
|
|
|
#2 (permalink) |
|
Surpass Fan
Excelling Contributor
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
921 posts
Gave thanks: 2
Thanked 91 times
|
Cron format for php file:
php /path/to/file/and/name I would suggest placing it above the public_html directory so it cannot be run from a browser, so your command would be: php /home/***/name_of_file.php
__________________
Where would you be if you were at the highest court in the land (US)? |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Seasoned Poster
Joined in Feb 2008
Lives in Kingdom Of Saudi Arabia
Hosted on i have my own server :)
35 posts
Gave thanks: 1
Thanked 3 times
|
thx
i was using /usr/local/bin/php /home/***/public_html/clean.php i will try to use php only 10x again for ur help ![]() |
|
|
|
|
|
#5 (permalink) |
|
Surpass Fan
Excelling Contributor
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
921 posts
Gave thanks: 2
Thanked 91 times
|
Have support take a look at your server setup.
__________________
Where would you be if you were at the highest court in the land (US)? |
|
|
|