Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Cron Job php help plz

Cron Jobs

6:23 am on Oct 9, 2008 (gmt 0)

New User

5+ Year Member

joined:Oct 9, 2008
votes: 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]

5:47 pm on Oct 9, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:May 4, 2002
votes: 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.
12:19 am on Oct 10, 2008 (gmt 0)

New User

5+ Year Member

joined:Oct 9, 2008
votes: 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.