View Full Version : Cron Job Help
Drompo
04-06-2007, 07:56 PM
I am trying to make a file run every monday night at 4am.
I have the following code
04**1 /usr/bin/lynx -source /home/habbocou/www/Panel/test.phpIt doesn't work.
What is wrong.
I've Tryied google and got nowhere
Drompo
04-06-2007, 08:19 PM
Sorry For double post but i need this quite soon.
Any Helpful Information/help Given will get +rep
Mashi
04-06-2007, 08:45 PM
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 >?
Drompo
04-06-2007, 08:46 PM
The script is fine.
I just want it to run which it won't
Florx
04-06-2007, 09:05 PM
0 4 * * * * php -q /home/username/public_html/path/to/file.php
Drompo
04-06-2007, 09:08 PM
0 4 * * * * php -q /home/username/public_html/path/to/file.php
Doesn't work
Florx
05-06-2007, 02:34 PM
does for me :)
I am trying to make a file run every monday night at 4am.
I have the following code
04**1 /usr/bin/lynx -source /home/habbocou/www/Panel/test.phpIt doesn't work.
What is wrong.
I've Tryied google and got nowhere
might have something to do with the file not being in public_html?
Florx
05-06-2007, 03:07 PM
How do you know it doesn't work. You replied like 2 mins later. The cron job is set to run at 4am :p
Luckyrare
05-06-2007, 03:11 PM
might have something to do with the file not being in public_html?
Why would it have to be in public_html? One of my servers is on /www/
Why would it have to be in public_html? One of my servers is on /www/
yes but the code florX posted says public_html in it he may not have changed it.
Oo. i think i quoted the wrong comment :P
RYANNNNN
05-06-2007, 03:38 PM
php -f /path/to/file.php
Drompo
05-06-2007, 03:56 PM
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?
Drompo
05-06-2007, 06:28 PM
None of the codes that have been posted so far work.
Any more or have an ideas why they don't work
RYANNNNN
05-06-2007, 07:55 PM
Use cpanel for when you run it and my code, it works because I use it myself for my own cronjob.
Drompo
05-06-2007, 08:06 PM
php -f /home/habbocou/www/Panel/test.php
That then?
RYANNNNN
05-06-2007, 08:20 PM
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.
Drompo
05-06-2007, 08:33 PM
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
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("ashley.cusack@yahoo.co.uk", "Cron Sucessful", "The Cron Job was Sucessful");
?>
ScottDiamond
05-06-2007, 09:29 PM
might have something to do with the file not being in public_html?
I'm going to remind you what Heinous said to you earlier. Log the hell out. Now.
Drompo
06-06-2007, 04:09 PM
it is in the public_html though
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.