I want to run a script every 24 hours, that scrapes a website and fetches data, save it to my local MySQL database, and push its DB to my remote Heroku or IBM Bluemix MySQL server (or ClearDB). I did this set of procedures in my Mac Pro in the past using
launchd, but since I now have MacBook Pro only, I cannot ensure that this is always done properly, because I occasionally close the laptop.
I know how to set the
launchd to execute the script once the laptop wakes up, but I still must make sure that this script is executed in the correct time, because the remote database must be set up to be updated every day to ensure that users in my iOS app always see the updated datasets.
How can I set it up so that the script is always executed in the exactly same time every day, such as 23:15, even in the laptop is being sleep? I have never shut down the laptop; I just close the tab and go into sleep.