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?
php question
Collapse
X
-
Unix/Linux servers can execute it for you every 12/24 hours, whatever you choose. -
how do i do that?Originally posted by UltraSonic
Unix/Linux servers can execute it for you every 12/24 hours, whatever you choose.
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?Comment
-
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...Comment
-
lmao.Originally posted by fishy
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...C:\Code\
C:\Code\Run\Comment
-
Make a cronjob that executes every 12/24 hours........ how to do it: RTFM (yahoo: +howto +cron) or install webmin.Originally posted by alex79
how do i do that?
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?Comment
-
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
Comment
-
Comment
-
-
Might be because you have to restart the crontab i thinkOriginally posted by alex79
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?Comment
-
restart crontab???? huh??Originally posted by UltraSonic
Might be because you have to restart the crontab i think
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 ....Comment
-
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
richEmail: [email protected]Comment
-
Comment


Comment