Cron expression with excluding of a specific day of week
Using cronmaker.com, an example Cron schedule that executes every day except Monday at 12pm would be:
0 0 12 ? * TUE,WED,THU,FRI,SAT,SUN *
Obviously the site will let you tailor this as required, but hopefully if the site ever goes down, and someone has a similar example, they will be able to use this expression as a guide to creating their own.
Schedule Cron to skip first Saturday of every month
Since there seem to be no option in Cron.
I'm going with script for the above need.
**if [ $(date +%d) -le 7 ] && [ $(date +%u) -eq 1 ] ;**
[ $(date +%d) -le 7 ]
- Checks if the days fall in first 7 days of month
[ $(date +%u) -eq 6 ]
- Checks if day is equal to Saturday
Thanks.
Spring Cron expression to exclude running job on one day for set times
Try
@Scheduled(cron = "0 15 2-23 * * SUN")
Crontab skip run once a week
Make it 2 lines:
0 0,8,16 * * 0-5
At minute 0 past hour 0, 8, and 16 on every day-of-week from Sunday through Friday.
And
0 8,16 * * 6
At minute 0 past hour 8 and 16 on Saturday.
You can change the day and hour which you want to skip, but there is no way to do this in 1 line as far as I know.
Related Topics
How to Preserve Command Line Spaces in a Linux Application
Gentoo Crontab: Why This Simple Crontab Is Not Working
How to Write Multiple Line String Using Bash with Variables
Any Way to Exit Bash Script, But Not Quitting the Terminal
Suppress Echo of Command Invocation in Makefile
How to Convert Date to Unix Timestamp in Shell Script on MACos
Append Line to /Etc/Hosts File with Shell Script
How I Should Run My Golang Process in Background
What Is the Reason and How to Avoid the [Fin, Ack] , [Rst] and [Rst, Ack]
How to Search for Files and Zip Them in One Zip File
How to Start Postgresql Service on Centos 7
Stracing to Attach to a Multi-Threaded Process
Process Permanently Stuck on D State
Automatic Docker Login Within a Bash Script
How to Configure Curl to Only Show Percentage
When Should I Write a Linux Kernel Module
Loading Module on Keyboard Hotplug
How to Use Linux Command Sort to Sort the Text File According to 4Th Column, Numeric Order