Backup Schedule Help - Last Day Of Month

briansbits

New Member
Feb 22, 2024
7
2
3
Hello,

I'm not sure if this post belongs in the Proxmox VE forum or in the Proxmox Backup Server forum, please forgive me if this is in the wrong place, but since backup jobs are configured and scheduled in Proxmox VE I'm posting here.

I have created several backup jobs to backup my VM's at certain intervals on certain days. I've got everything sorted out and working as I'd like except for getting a job configured to run on the last day of the month. I can't seem to figure out the syntax for the schedule on this one. Some months end on the 30th, some on the 31st, February ends on the 28th, and once every 4 years it ends on the 29th.

Systemd OnCalendar event syntax for this doesn't work. The OnCalendar syntax uses a tilde ~ between the month and day position to indicate the last day of the month. Eg: *-*~1 would be the last day of the month, where *-*~3 would be the third last day of the month. This was implemented on March 1, 2017. See here: https://github.com/systemd/systemd/blob/v233/NEWS#L174

Is a similar functionality available in the Proxmox scheduler? I have looked at the documentation, trial and error'ing, and searching the interwebs... and wasn't able to come up with anything.
 
Is this for work or homelab?

One way to solve this problem is to run the backup every day from the 28th-31st and only keep the last one. With PBS this should be fairly easy and space-efficient with dedup.

But typically you would call a wrapper script that checks date or cal and only proceeds if it determines the right conditions.

https://search.brave.com/search?q=p...summary=1&conversation=6cb9f4bb21428aef9ccd22

Is there any limitation on running this backup just after midnight on the 1st of the month instead? That would probably be easier. Sometimes you gotta think outside the box.
 
  • Like
Reactions: UdoB
Is there much difference between doing it on the last day, or the first at 00:01?

Since there are a variable number of days in each month... (Feb 2026 only goes up to 28, some have 31, some have 30)

https://search.brave.com/search?q=c...summary=1&conversation=996d3c24e85e8df1671a1f

You can do this with cron by running a test in crontab or the actual code, not sure about PVE scheduling since it doesn't use cron