homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Gold Sponsor 2015!
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Cron Job php help plz
Cron Jobs

5+ Year Member

Msg#: 3761829 posted 6:23 am on Oct 9, 2008 (gmt 0)

I know there are many discussions about this same topic and I have gone through as many of them as I could while trying out the different suggestions... all haven't worked. I will supply as much information as I know.
First of all, all I want to know is what to type into the field that says "Cron Job" on my cron manager page for cron jobs and next to it are fields labeled "month", "weeks", "days", "hours", "minutes". I believe setting those all to 0 should be setting frequency to every minute? My host is <snip> (i beleive the php used on it is Apoch 2.0 and a linux server).
All I want to do is test the cron job utility to see it work. I made a text file called "cront.txt" with a zero digit in it. Then I made a php page called "cront.php" that when loaded increases the value in "cront.txt" by one. here is my script for php page:
$file = fopen("cront.txt", "r");
$content = fread($file, filesize("cront.txt"));
$fill = fopen("cront.txt", "w");
fwrite($fill, $content);
After I click "add" it displays a table with columns labeled "Cron Job, Script, (and then the frequency signature)" under Cron Job it shows whatever I typed in the "Cron Job" input field(exactly as i typed it), and under script it shows nothing.
All I wanted to do was test out cron jobs with my Cront files but when i look into the file of "cront.txt" it stays 0 which means the code isn't being run at those intervals supposedly.
Can someone please tell me what in the blazes i type into that field?
PS. my cront files are both in the head directory (or watever directory the index.html file is in)


[edited by: dreamcatcher at 7:36 am (utc) on Oct. 9, 2008]
[edit reason] No urls please! [/edit]



10+ Year Member

Msg#: 3761829 posted 5:47 pm on Oct 9, 2008 (gmt 0)

Setting them all to 0 will mean that your cron won't ever get executed. Set them all to * to get it to run every minute. To run it at midnight every day, use 0 0 * * *. To run it at 10 every day, use 10 0 * * * &c. You can execute your PHP scripts from the cron tab using the curl command.


5+ Year Member

Msg#: 3761829 posted 12:19 am on Oct 10, 2008 (gmt 0)

Well here are the options for each drop down menu:

"Months"-> 'Select',1,2,3,4,5,6,7,8,9,10
"Weeks"-> 'Select',1,2,3,4
"Days"-> 'Select',01,02,03,...,29,30,31
"Hours"-> 'Select',1,2,3,...,21,22,23,0
"Minutes"-> 'Select',05,10,15,...,50,55,00

There is also the "Cron Job" field before those, and yes I don't understand why "Months" only goes to 10. I also don't understand why some of the fields have a zero and some don't.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved