I would like some help to setup a cron job to run every 10 minutes and stop on next Monday at 00:00:00.
0 0 30 3 * /var/www/html/reports/Test.php
There is no such facility in cron
per se. But you can achieve your goal as explained below. I have not put exact commands - but this is the idea that will work.
/etc/cron.d
with a file name like: /etc/cron.d/<your login name>-test-reports.php
. Using your login name as part of the script file name reduces the possibility of file name conflicts. Place time specification and the command you want to run in the script. This may need root privileges because /etc/cron.d is rw
only to root user.at
script to delete your cron file from /etc/cron.d on the date and time of your interest. You can also determine next Monday's date using command: date --date "next Monday"
to avoid hard coding a date in your at
script.