Autopilot - How to handle Backups taking longer than Schedule #746

Closed
opened 2023-08-17 12:59:34 +00:00 by xLogiiCx · 3 comments

What I'm trying to do and why

I am trying to Automate my Backups using Cron or Systemd.
The question I asked myself was how to make sure that the backups don't get in each other's way.
For example if my schedule is hourly what should i do if the Backup takes longer than that?
Should i kill the borg/borgmatic process beforehand and then remove the log when my Backup starts again?

Steps to reproduce

No response

Actual behavior

No response

Expected behavior

No response

Other notes / implementation ideas

No response

borgmatic version

No response

borgmatic installation method

No response

Borg version

No response

Python version

No response

Database version (if applicable)

No response

Operating system and version

No response

### What I'm trying to do and why I am trying to Automate my Backups using Cron or Systemd. The question I asked myself was how to make sure that the backups don't get in each other's way. For example if my schedule is hourly what should i do if the Backup takes longer than that? Should i kill the borg/borgmatic process beforehand and then remove the log when my Backup starts again? ### Steps to reproduce _No response_ ### Actual behavior _No response_ ### Expected behavior _No response_ ### Other notes / implementation ideas _No response_ ### borgmatic version _No response_ ### borgmatic installation method _No response_ ### Borg version _No response_ ### Python version _No response_ ### Database version (if applicable) _No response_ ### Operating system and version _No response_
Owner

borgmatic doesn't have any formal support for this use case, but my recommendation would be: Allow the occasional long-running backup to complete without being disturbed. I'm not sure you'd gain a whole lot by killing it and starting a new backup, and you may actually make things worse if a complete backup never finishes because it gets killed once an hour. Also note that if you're using a systemd timer, I believe it already takes care of this for you. From the systemd timer docs:

Note that in case the unit to activate is already active at the time the timer elapses it is not restarted, but simply left running. There is no concept of spawning new service instances in this case.

I hope that helps!

borgmatic doesn't have any formal support for this use case, but my recommendation would be: Allow the occasional long-running backup to complete without being disturbed. I'm not sure you'd gain a whole lot by killing it and starting a new backup, and you may actually make things worse if a complete backup never finishes because it gets killed once an hour. Also note that if you're using a systemd timer, I believe it already takes care of this for you. From the [systemd timer docs](https://www.freedesktop.org/software/systemd/man/systemd.timer.html): > Note that in case the unit to activate is already active at the time the timer elapses it is not restarted, but simply left running. There is no concept of spawning new service instances in this case. I hope that helps!
witten added the
question / support
label 2023-08-17 16:12:12 +00:00
Author

Also note that if you're using a systemd timer, I believe it already takes care of this for you. From the systemd timer docs:

Great hint, i am gonna use this. Thanks

> Also note that if you're using a systemd timer, I believe it already takes care of this for you. From the systemd timer docs: Great hint, i am gonna use this. Thanks
Owner

Sounds good!

Sounds good!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#746
No description provided.