Skip to main content
added 18 characters in body
Source Link
DopeGhoti
  • 79.2k
  • 10
  • 107
  • 141

Put thisthe script in question into your crontab:

0 1 * * 1 [[ "$(/bin/date +\%d)" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Put this into your crontab:

0 1 * * 1 [[ "$(/bin/date +\%d)" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Put the script in question into your crontab:

0 1 * * 1 [[ "$(/bin/date +\%d)" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Fixed missing command substitution closing parentheses; grammar
Source Link

Put itthis into theyour crontab:

0 1 * * 1 [[ "$(/bin/date +\%d"+\%d)" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Put it into the crontab:

0 1 * * 1 [[ "$(/bin/date +\%d" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Put this into your crontab:

0 1 * * 1 [[ "$(/bin/date +\%d)" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

added 1 character in body
Source Link
DopeGhoti
  • 79.2k
  • 10
  • 107
  • 141

Put it into the crontab:

0 1 * * 1 [[ "$(/bin/date +%d"+\%d" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Put it into the crontab:

0 1 * * 1 [[ "$(/bin/date +%d" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Put it into the crontab:

0 1 * * 1 [[ "$(/bin/date +\%d" -le 7 ]] && /path/to/script.sh 

On every Monday at 0100, it will check to see if the date is less than or equal to the seventh, and if so, run the script.

Bonus to using this is it's very easy to reschedule for Tuesdays without having to edit the script.

Source Link
DopeGhoti
  • 79.2k
  • 10
  • 107
  • 141
Loading