Feature: timeout #411

Closed
opened 2021-04-17 20:42:43 +00:00 by Derkades · 3 comments

What I'm trying to do and why

For long running backups (e.g. when a large amount of files are added at once) I would find it useful to make the backup stop after a while.

Currently, if the backup runs long enough where cron starts a second instance, it sometimes runs into issues like healthchecks failing or database dumps not being created or deleted properly. Of course, backup integrity is ensured by borg locks but it still requires manual intervention or causes unnecessary notifications.

I propose a configuration option

timeout: 20h

that will stop borgmatic after some amount of time (if doable, preferably waiting for the next checkpoint).

This feature has other uses, like ensuring backups are run during idle hours. For example, starting a backup at 2 AM and always stopping it before 8 AM even if it hasn't finished yet (it will continue the next day).

#### What I'm trying to do and why For long running backups (e.g. when a large amount of files are added at once) I would find it useful to make the backup stop after a while. Currently, if the backup runs long enough where cron starts a second instance, it sometimes runs into issues like healthchecks failing or database dumps not being created or deleted properly. Of course, backup integrity is ensured by borg locks but it still requires manual intervention or causes unnecessary notifications. I propose a configuration option ```yaml timeout: 20h ``` that will stop borgmatic after some amount of time (if doable, preferably waiting for the next checkpoint). This feature has other uses, like ensuring backups are run during idle hours. For example, starting a backup at 2 AM and always stopping it before 8 AM even if it hasn't finished yet (it will continue the next day).
Owner

Great idea! Are you perhaps using systemd to run borgmatic? If so, you might be able to accomplish a timeout via systemd's TimeoutSec service option. It still might make sense to add timeout support to borgmatic, but I wanted to see if systemd's timeout would work for you in the meantime.

Great idea! Are you perhaps using systemd to run borgmatic? If so, you might be able to accomplish a timeout via [systemd's TimeoutSec service option](https://unix.stackexchange.com/questions/227017/how-to-change-systemd-service-timeout-value). It still might make sense to add timeout support to borgmatic, but I wanted to see if systemd's timeout would work for you in the meantime.
Owner

I'm closing this ticket due to inactivity. But please feel free to reopen if you have any follow-up comments.

I'm closing this ticket due to inactivity. But please feel free to reopen if you have any follow-up comments.
Author

Fair enough, I've managed to solve the issue of concurrent backups using run-one.

Fair enough, I've managed to solve the issue of concurrent backups using `run-one`.
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#411
No description provided.