'Cron Expression to trigger every previous Month File
I am trying to schedule a cronjob to get triggered on the 4th of every month at 9 AM, which is fine. But I want to schedule a cronjob to run on every previous month of the current date.
Ex:
Schedule - 202105(YYYYMM) - 0 9 4 * *
Expected - 202104(YYYYMM) -?
If I'm executing on May 4th 2021 9 AM, it has to trigger for April 4th 2021, that means it has to run for previous month files. Is it possible to schedule a cronjob in a way to pick previous month files on current month execution?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
