[ILUGC] Re: Need help on crontab - run a script on every month second saturday - 3 PM

  • From: Sumīt Viks <vkslist@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx
  • Date: Wed, 9 Sep 2020 17:49:04 +0530

On Wed, 9 Sep 2020 at 13:38, Shrinivasan T <tshrinivasan@xxxxxxxxx> wrote:
 [...]
I need to run a scheduled script using crontab or airflow.


The time is - every month second saturday - 3 PM

How to set this in crontab?

[...]

# On a Linux box
$ man 5 crontab
...
EXAMPLE CRON FILE
       The following lists an example of a user crontab file.

       # IMPORTANT: use /bin/bash to run commands, instead of the default
/bin/sh
       SHELL=/bin/bash
...
       # mail any output to `paul', no matter whose crontab this is
       MAILTO=<SET THIS TO GET EMAILS>
       #
...
       # Run at 4am on every second Saturday of the month
       0 4 8-14 * *    test $(date +\%u) -eq 6 && echo "2nd Saturday"

Best,
/s


---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on irc.freenode.net

Other related posts: