Issue
I am trying to write a crontab job that will run for 12 months and stop running after that period of time. Kind of like a license that renews every year. Is this possible?
My thought process is using the date
command within the crontab -e
file.
Any ideas on this will be greatly appreciated, Thank you.
Solution
Prepare license-check script. Its task is to verify your monthly script is valid. If monthly script not valid disable monthly script.
- Put your monthly script in /etc/cron.monthly
2.1 Use at
command to run 'license-check' on your monthly script at specific time. Once.
or
2.2 Use crontab
to run 'license-check' once a year.
Answered By - Dudi Boy Answer Checked By - David Goodson (WPSolving Volunteer)