All,
I'm a newbie with crontab and I need your help with schedule a cold-backup running every Sunday at 7am except 1st of the month.
Thank you so much.
All,
I'm a newbie with crontab and I need your help with schedule a cold-backup running every Sunday at 7am except 1st of the month.
Thank you so much.
Read the 2 steps described bellow:
* * Sunday 7am 0 command
0 7 Sunday * * command
And the day is defined as a number - you need to verify this but I think that Sunday=7, thus the final code is:
0 7 7 * * command
$(date +%d) != '01'
You should use this as a conditional to your command:
[[ $(date +%d) != '01' ]] && backup_command
Verify if this works and you might need to tune this for your OS, coreutils and shell
Final entry in cron would look like:
0 7 7 * * [[ $(date +%d) != '01' ]] && backup_command