I am trying to make a file run every monday night at 4am.
I have the following code
It doesn't work.PHP Code:04**1 /usr/bin/lynx -source /home/habbocou/www/Panel/test.php
What is wrong.
I've Tryied google and got nowhere
Printable View
I am trying to make a file run every monday night at 4am.
I have the following code
It doesn't work.PHP Code:04**1 /usr/bin/lynx -source /home/habbocou/www/Panel/test.php
What is wrong.
I've Tryied google and got nowhere
Sorry For double post but i need this quite soon.
Any Helpful Information/help Given will get +rep
Just Make It Grab The time Off The Net And Then check With your PHP Script Time (Constant). At 04.00 it will run. i dont know about the monday bit maybe do it x7 >?
The script is fine.
I just want it to run which it won't
0 4 * * * * php -q /home/username/public_html/path/to/file.php
does for me :)
How do you know it doesn't work. You replied like 2 mins later. The cron job is set to run at 4am :p
php -f /path/to/file.php
The File is in public_html/Panel/test.php
In responce to FlorX i changed the times to run a minute after
public_html and www are the same. Doesnt cpanel set you a cron up anymore?
None of the codes that have been posted so far work.
Any more or have an ideas why they don't work
Use cpanel for when you run it and my code, it works because I use it myself for my own cronjob.
php -f /home/habbocou/www/Panel/test.php
That then?
Yes, assuming you have cpanel, add it in there, use the basic view and not the advanced view when you click cron jobs. That way you can set the time easily.
I'm beginning to sound a real noob now. It still won't work.
Any ideas.
The File i want it to run is below
PHP Code:<?php
include("config.php");
mysql_query("TRUNCATE TABLE table");
$query = mysql_query("SELECT * FROM `staff` ORDER BY RAND() LIMIT 3") or die('Could not delete request: '.mysql_error());
while ($view = mysql_fetch_array($query)) {
mysql_query("INSERT INTO `table` (`name`, `day`) VALUES ('{$view["username"]}', '$numday')") or die ("Error");
}
mail("[email protected]", "Cron Sucessful", "The Cron Job was Sucessful");
?>
it is in the public_html though