Run backup script at any time every weekend (using launchd?)

backupcronlaunchd

I recently lost configuration of one of my IDEs (deleted it myself, I am very smart). I had a backup but it was a few months old. I have a script to backup all my config and push it to GitHub. I was looking into a way to run a script every week to back up everything automatically but launchd / cron need a specific time to run. My laptop might not be running at that time but I do boot up my laptop every weekend at least once.

Is there a way to configure launchd / cron to run on a weekend at any time to back up my configuration?

Edit

To make it clear, the question is not a duplicate of the one posted in the comments. The other question talks about running a script "10 minutes after 2 am every weekday only", not anytime possible on a weekend. Only once per weekend.

Best Answer

Set your computer to power on or wake from sleep on a specific day and time (Energy Saver preferences), then run your script though launchd or cron within that time frame.