Unix & Linux Asked by Tim_drake931 on January 3, 2022
What will be the cron job for scheduling a script for every day except second Sunday and fourth Sunday of the month.
Thanks
Although I think it's a bad idea and it would be better to run it every 14 days, this should do what you want. (To run at 4:00 at night)
0 4 1-7 * * test $(date +%u) -eq 7 && ./yourscript.sh
0 4 15-21 * * test $(date +%u) -eq 7 && ./yourscript.sh
0 4 22-31 * * test $(date +%u) -eq 7 && ./yourscript.sh
Edit: I forgot to add minutes -> fixed
Answered by Garo on January 3, 2022
2 Asked on October 31, 2021 by luis-santos
2 Asked on October 31, 2021 by chameleonscales
bash gnu parallel io redirection process substitution zenity
3 Asked on October 31, 2021 by michael-davis
1 Asked on October 31, 2021
1 Asked on October 31, 2021 by raywando
4 Asked on October 31, 2021 by brocharvey
0 Asked on October 31, 2021
1 Asked on October 31, 2021 by x6herbius
1 Asked on October 31, 2021
0 Asked on October 31, 2021 by ajgringo619
1 Asked on October 31, 2021
0 Asked on October 31, 2021 by lunit
1 Asked on October 31, 2021
0 Asked on October 31, 2021
0 Asked on October 31, 2021 by krasimir-iliev-velichkov
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP