[SOLVED] Fortnightly deposit

michaldejmek

New Member
Feb 23, 2024
3
1
3
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:
Something like this will work:

Code:
*-*-*/15 03:00

"make a backup any year, any month, on days divisible by 15 at 3:00 AM"

You could also do:

Code:
*-*-1,15 03:00

"make a backup any year, any month, on days 1 and 15 at 3:00 AM"

Details here.
 
  • Like
Reactions: UdoB
Never tried it but based on this page, I guess this ought to work:
Code:
sun *-1..7,15..21 02:00
It will do the backup on the 1st & the 3rd Sunday of each month at 2AM
 
  • Like
Reactions: VictorSTS and UdoB
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.

Code:
sun *-1..7,15..21,29..31 02:00
This will cause an ADDITIONAL backup for that 5th Sunday of the month - with the next backup being a week later.

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).
 
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.

Code:
sun *-1..7,15..21,29..31 02:00
This will cause an ADDITIONAL backup for that 5th Sunday of the month - with the next backup being a week later.

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).
Thank you so much for your help. That's exactly what I need..
 
  • Like
Reactions: gfngfn256