Well, PHP is not the language that does the cron job. There is a program on Linux machines called cron. There is also a similar program on Windows machine, but I do not know what its called.
PHP can execute that program by using the exec() function.
thnaks cherubini
i know the function of exec() but the question is what exactly the cron does?
as far as i know it does a particular task on regular basis
but can u tell me how to set up a cron job?
say i want to send email every day on some specific time.can it be done thru cron?
I find that the .edu college sites offer the best advice.
Basically, you can enter
->crontab -l to list your jobs
->crontab -r to remove them
->crontab -e to edit them
while your testing the best way I found was to create a file with pico called say cronjobs then issue a
->crontab cronjobs
cronjobs will look something like:
0 0 * * 0 /home/users/bofh/zaplogfiles
which runs a zaplogfiles batch on midnight every sunday.
Other considerations:
you have to leave a blank line after your last crontab entry else it wont work (dont know if true)
crontab will only start the job when it reaches the time - it won't backdate jobs if you submit them a few minutes after the scheduled time.
I dont know wether the jobs are triggered with reference to your hardware clock or you software clock - if things arent running on time then see if you can find a clocksync utility.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.