I understand I can set a cron job to run every 5 minutes with crontab -e
by adding a line such as: */5 * * * * /path/to/script.sh
.
Is it possible to get the system time in minutes using date +"%M"
for example, and then set a cron job to run at date +"%M"
plus 5 minutes?
I know I can get date +"%M"
+ 5 via the following process:
$ MIN=`date +"%M"`
$ export MIN
$ expr $MIN + 5
Is it possible to use this to set a cron job or script to run at "current time in minutes" plus "X minutes"?
I could imagine this being useful in an application in which a user creates a new document and then is prompted to save or title the document X minutes after creating it.