Issue
I want to delete some files every day at 6am. I was thinking about using crontab to schedule this task with something like
0 6 * * * sudo rm path/to/file
But my raspberry Pi will most likely be off at this time and turned on later during the day.
So my question is : If the RPi happens to be off while it should be executing the comand, does the task run at boot ?
I can't use @reboot
because the raspberry can be powered off during the day and files should only be deleted once a day at 6am
Solution
The at and cron commands are only launched when the system date corresponds to the date scheduled for execution. There is no catch-up if the machine is turned off at the scheduled execution time.
a solution for you would be to code your own scheduling script and run it at daemon service
Answered By - Jerome Favrou