![]() |
php question
i have a php script (page) that i want to be executed at every 12/24 hours.. how can i do so the script to be automaticaly executed at a fixed date from the day?
|
Unix/Linux servers can execute it for you every 12/24 hours, whatever you choose.
|
cron
|
Quote:
let's say that the php script is located at /home/script.php can somebody explain me exactly what i have to do so the script.php to be automaticaly executed at a fixed hour each day? |
Teach a monkey to type in the text, then give the monkey a big banana every 12/24 hours. Don't make it sign any agreements, don't know if it will agree to do that. I know these monkeys drive a hard bargain...
|
Quote:
|
Ask your host
|
Quote:
|
Quote:
|
Quote:
|
make a cron job,
or hit f5 twice a day :1orglaugh |
Maybe this helps:
Example Crontab: # r----minute # | r-----hour # | | r------day of the month # | | | r------month # | | | | r------day of the week # | | | | | |------ command to run -------------> # | | | | | | 5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1 # run five minutes after midnight, every day 15 14 1 * * $HOME/bin/monthly # run at 2:15pm on the first of every month -- output mailed to paul 0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?% # print out the message at 4:05 every sunday. 5 4 * * sun echo "run at 5 after 4 every sunday" If this file were saved as "paul.ct" then crontab -u paul paul.ct would be used to store the crontab for the user paul. For more information: man cron man crontab man 5 crontab If it doesn't help..... back to yahoo and howtos :) |
if i type this line from ssh
php /home/script.php > /dev/null the script.php is executed but if i write this line in crontab: * * * * * php /home/script.php > /dev/null or 30 7 * * * php /home/script.php > /dev/null is not executed.. what can be the problem? |
Use wget instead and specify the external address.
|
Quote:
|
Quote:
that works 30 1 * * * /usr/local/bin/wget --spider -q http://www.yourdomain.com/path/script.php >/dev/null 2>&1 the path top wget you can get with 'whereis wget' (SSH or telnet) if it's htaccess/ htpasswd protected... then http://user:[email protected]/path/script.php .... |
alex
you shouldn't need to re-start cron -- it re-loads all crontab changes automatically. The reason your crontab entry didn't run was probably because cron couldn't find the php binary ... try again with the full path to your php binary e.g. * * * * * /usr/bin/php -q /home/script.php > /dev/null 2>&1 hth rich |
crontab is your solution...
|
All times are GMT -7. The time now is 05:17 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123