Hello, can you help me back up the definition? I need to run a backup once a fortnight on Sunday at 2:00. Thank you.
Last edited:
sun *-1..7,15..21 02:00
Well, my brain kept just the "fortnight" part and forgot the "Sunday" one. Still gave you a pointer and a link to the documentation that could have followed too...@VictorSTS - This task runs every 15 days of the month. And where does it say it's supposed to run on Sunday?
sun *-1..7,15..21,29..31 02:00
Thank you so much for your help. That's exactly what I need..Please note that my above suggestion will ONLY trigger on the 1st & 3rd Sundays of the month. So in a month with 5 Sundays instead of 4, you will have a 3 week space of no backups between the second Sunday of that month until the first Sunday of the coming month. For example, the coming month of August 2025, has 5 Sundays on the 3rd, 10th, 17th, 24th & 31st. So with the above logic, you will have a backup on the 3rd & the 17th but not on 31st, & the next backup will only be on the 7th of September; a three week interval instead of the requested fortnight.
If you decide, to cover this by adding a backup for such an occasion, it is also pretty simple: Since the possibility of a 5th Sunday in a month can only happen between the 29th & 31st of any month, you could do the following to add a backup for that "extra" Sunday.
This will cause an ADDITIONAL backup for that 5th Sunday of the month - with the next backup being a week later.Code:sun *-1..7,15..21,29..31 02:00
In my quick calculations, it appears that there are an average of 4.2 months a year that have 5 Sundays. So every year instead of getting 26 backups (52 weeks fortnightly) you would have 30 backups (& occasionally 31, for example in the year 2028).
We use essential cookies to make this site work, and optional cookies to enhance your experience.