I have a python script which I want to run daily at let's say 9 am. But if the system is not on at that time, the script should run as soon as the computer gets turned on again.
I'm looking for something like anacron.
How can I achieve this? Cron job doesn't fulfill my purpose.
Create a Launch Daemon file, set its ownership to root:wheel and permissions to 644, and place it in /Library/LaunchDaemons. At minimum, the file should contain something like this:
Note that although a missed run of the daemon will be made up at the next opportunity, it'll "coalesce" multiple missed runs. For example, if the computer is off for 5 days, the daemon will be run just once when it finally starts up.