Skip to main content
added 126 characters in body
Source Link
Hauke Laging
  • 94.8k
  • 21
  • 132
  • 185

You could have cron run a script on every Monday and have the script check whether the day of the month is 1 to 7.

This check can either be integrated in your main script or you can write a wrapper script so that you do not have to make this change to the main script so that it can run.

if [[ $(date +%d) =~ 0[1-7] ]]; then : run script fi 

Checking both day of week and day of month:

if [[ $(date +%w%d) =~ 10[1-7] ]]; then : run script fi 

You could have cron run a script on every Monday and have the script check whether the day of the month is 1 to 7.

This check can either be integrated in your main script or you can write a wrapper script so that you do not have to make this change to the main script so that it can run.

if [[ $(date +%d) =~ 0[1-7] ]]; then : run script fi 

You could have cron run a script on every Monday and have the script check whether the day of the month is 1 to 7.

This check can either be integrated in your main script or you can write a wrapper script so that you do not have to make this change to the main script so that it can run.

if [[ $(date +%d) =~ 0[1-7] ]]; then : run script fi 

Checking both day of week and day of month:

if [[ $(date +%w%d) =~ 10[1-7] ]]; then : run script fi 
Source Link
Hauke Laging
  • 94.8k
  • 21
  • 132
  • 185

You could have cron run a script on every Monday and have the script check whether the day of the month is 1 to 7.

This check can either be integrated in your main script or you can write a wrapper script so that you do not have to make this change to the main script so that it can run.

if [[ $(date +%d) =~ 0[1-7] ]]; then : run script fi