Page 1 of 1

Cron job Testing

Posted: Fri Aug 10, 2007 9:27 am
by Abhishek
Hi,

I have this script which processes customers orders everyday. The script is supposed to run everyday and process orders for customers whose date is same as current date (e.g 10 Aug). And then it also calculates the next date (e.g 10 Sep) and saves in the db. Also other db related manipulations are done.

On the next date (i.e 10 Sep), it again will process for same customers.
Now my client wants a real time testing scenario where I do not need to go to the db to manipulate date and run the cron script. He wants to modify the system date rather and want the cron script to run as normal. Is that possible.

Please give me some thoughts.

Abhishek

Posted: Fri Aug 10, 2007 9:31 am
by VladSun
man crontab shows:
crond automatically detects changes in the time. Reverse-indexed time changes less then an hour old will NOT re-run crontab commands
already issued in the recovered period. Forward-indexed changes less then an hour into the future will issue missed commands exactly
once. Changes greater then an hour into the past or future cause crond to resynchronize and not issue missed commands. No attempt
will be made to issue commands lost due to a reboot, and commands are not reissued if the previously issued command is still running.
For example, if you have a crontab command 'sleep 70' that you wish to run once a minute, cron will only be able to issue the command
once every two minutes. If you do not like this feature, you can run your commands in the background with an '&'.