How to plan crontab launch on the first Saturday of every month?
Try this (start at midnight on the first Saturday of the month):
# Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue... # | | | | | # * * * * * command to be executed 0 0 1-7 * * [ $(/usr/bin/date +\%u) == 7 ] && command
Symbol %must be reset in accordance withman 5 crontab
%
man 5 crontab
This will start your work on the first Saturday of the month:
# First Saturday of the month 0 0 1-7 * * [ "$(date '+\%a')" == "Sat" ] && /home/scripts/your_script_file.sh
.
script . script, , , , .
# Example of job definition: # .---------------- minute (0 - 59) / 0 # | .------------- hour (0 - 23) / 10 at ten a.m. # | | .---------- day of month (1 - 31) / 1-7 because 8 can't be first saturday # | | | .------- month (1 - 12) / * = every month # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) / 1 = sat # | | | | | # * * * * * command to be executed 00 10 * 1-6 1
can be easily accomplished by working every month, at dates 1-7 and re-indicating busy days. Day 8 cannot be the first Saturday.
You can directly use the name of the day.
0 0 1-7 * sat script file.
For more help see the link .
Source: https://habr.com/ru/post/1568742/More articles:Error code: 1248. Each view must have its own alias. No solution was found for the request. - sqlApplication power closes on viewPager.setAdapter (adapter) - androidIs automatic dependency injection available in AngularJS? - angularjshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1568740/adding-custom-functions-to-xsl-in-delphi-7&usg=ALkJrhhZtCRYmC5Y9zxSHRHBC15SSmrd9Areverse connection pool proxy using user session endpoint? - apacheDownsampling a large 3D image in numpy - pythonjava.nio.charset.UnmappableCharacterException: Input length = 1 - xmlmsvc is_copy_assignable is always true? - c ++PHP string Replace the end of the string - stringMSVC - How can I find out if a type needs to be moved? - c ++All Articles