Cronjob for every second Saturday of the month
I was thinking of implementing a script in crontab to run a job every second Saturday of every month, or alternatively every two weeks on a Saturday.
I'm a bit stumped with this one, not sure how it would be specified? I was thinking along the lines of: Code:
10 7 * * 6 command to be executed Anyone have any ideas on this? |
OK, think I figured it out.
I'd specify the crontab to run whichever script I want to run every Saturday. The script itself though would then just do the following: Code:
PTS=/path/to/real/script Haven't tested it yet, but it should work right? |
You can just add a control statement at the beginning of the script using the date command to check if the current day is Saturday and if it is the second of the month (it will be between the 8th and 14th of the month):
Code:
#!/bin/bash |
Quote:
Thanks Colucix, I'll give it a go and see how it goes. |
All times are GMT -5. The time now is 07:34 PM. |