Hi,
I can’t set a CRON Job, here is an example of a cron file:
cat /var/spool/cron/zebizcom
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/CRONN1RXiN installed on Thu Mar 3 00:17:46 2005)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
PATH=/home/zebizcom/zebiz.com/html/
* * * * * t/test.php
You can see that I modified the default path because i tried with the default one and it never worked (it’s still not working) !
the file i want to run is located here:
*ttp://www.zebiz.com/t/test.php
It’s a simple script that put the time it was executed in a txt file
When i run it, it works fine, but not with the CRON
Don’t forget that PHP likes to spit out headers and such, and a lot of scripts don’t deal with this for you. If you wind up getting e-mails every 1 minute, append &>/dev/null to the end of the line. Its also fun logging in and seeing 6,000 empty files left behind by wget…
Oh yes thank you very much
that’s working fine now
And do you know how i can run a cronjob every 5 seconds or something like that (in seconds) ?
and also, as i’m new to CRON, how to set a cron job to run:
Every day at 11AM, every minute (or every 5 seconds if possible), during 1 hour? (after one hour it’ll stop)
Is this possible ?
You can’t schedule anything more often than once per minute.
The order for schedules is minute, hour, day of month, month, day of week, command so:
Daily at 11: 0 11 * * * command
Every minute during the 11th hour: * 11 * * * command
Of course, if its important something gets executed you’ll need to look into /etc/cron.{daily, weekly, hourly, monthly} or use something like this: http://blog.christopheringram.com/article/8/topic/3 (it does the same thing, only differently.)
Oh Thanks, acron looks great but a bit complicated for me
Oh yes thank you for the command… But, to really understand:
How would you set up a cron job that must be executed every minute, every day between 10h and 12h ?
Is that possible ? (i don’t need it, it’s just to know)