2

I would like an option/option or if there is a better solution from what I am going to present here to get this task accomplished:

My first option is this, but it seems complex:

# This run on every last Friday (or whatever weekday) of the month at 1AM
0 1 * * 5 [ $(date +"\%m") -ne $(date -d 7days +"\%m") ] code.pl

Or a more explicit way, every last Friday of every month at 1AM:

0 1 25-31 1,3,5,7,8,10,12 5 code.pl
0 1 24-30 4,6,9,11        5 code.pl
0 1 22-28 2               5 code.pl

Thanks for looking and suggestions!

Andre
  • 819
  • 3
  • 15
  • 30
  • You can call the script every Fridays and the script will launch once every 4 times ? – StrawHara Jun 25 '14 at 15:10
  • Your second method has a bug during leap years where the 29th of February is a Friday. This won't be a problem until 2036, though. – AKHolland Jun 25 '14 at 15:14

0 Answers0