Every 5 min cron job between specific time (Windows server 2008 and batch file)

947 views Asked by At

Previous colleague set up cron job every 5 min for 24 hrs.
Now I need to modify this only running between 7am to 7pm.

I had never learned cron job so I googled and tried but it didn't work.


Task Scheduler is set as below

enter image description here

And I modified the batch file from

C:\PHP\php.exe -f C:\path\cron.php five-mins

to

7-19/5 * * * * C:\PHP\php.exe -f C:\path\cron.php five-mins


Even I added 7-19/5 * * * * to batch file, it doesn't work.

It would be appreciative if someone can help me.
Thanks in advance and thanks for taking your time.

update

I found this question on https://superuser.com/questions/133456/run-a-cron-job-every-5-minutes-between-two-times and changed the batch file */5 7-19 * * * instead of 7-19/5 * * * * however still not working.


solved

Got a good solution from RedGrittyBrick on superuser.com https://superuser.com/questions/926549/every-5-min-cron-job-between-specific-time-windows-server-2008-and-batch-file

0

There are 0 answers