Idea: Configuration may include when to backup #616

Closed
opened 2022-11-26 13:12:24 +00:00 by lamyergeier · 5 comments

Rather than defining when to backup in the external tool like cron or systemd, we could define it in the configuration file(s). And every hour I can run borgmatic with systemd . Borgmatic could check the backup schedule defined in the configuration file, and determine if its necessary to backup and proceed accordingly.

What do you think? (This is how backintime works, it let user define the scheduling in the configuration itself and then edits the crontab. I am not asking you to edit crontab, but it would be nice if boegnmatic can determine if backup is necessary or not).

We could have a separate option for forced backup to disregard the schedule.

Rather than defining when to backup in the external tool like cron or systemd, we could define it in the configuration file(s). And every hour I can run borgmatic with systemd . Borgmatic could check the backup schedule defined in the configuration file, and determine if its necessary to backup and proceed accordingly. What do you think? (This is how backintime works, it let user define the scheduling in the configuration itself and then edits the crontab. I am not asking you to edit crontab, but it would be nice if boegnmatic can determine if backup is necessary or not). We could have a separate option for forced backup to disregard the schedule.
Owner

Thanks for filing this! On the one hand, I generally would like to avoid reinventing cron/systemd. On the other hand, the feature you described is basically how the consistency check frequency feature already works. (There's even an existing --force option to disregard the schedule.) And so it wouldn't be a big stretch—either technically or in terms of feature creep—to extend such functionality to backups.

I think my main question at this point is the why behind this ask. Is it just more convenient to do scheduling in borgmatic's configuration than via systemd?

Thanks for filing this! On the one hand, I generally would like to avoid reinventing cron/systemd. On the other hand, the feature you described is basically how the [consistency check frequency](https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#check-frequency) feature already works. (There's even an existing `--force` option to disregard the schedule.) And so it wouldn't be a big stretch—either technically or in terms of feature creep—to extend such functionality to backups. I think my main question at this point is the *why* behind this ask. Is it just more convenient to do scheduling in borgmatic's configuration than via systemd?
Author

I think its ok, users can use external tools like cron and systemd as you said. I saw the systemd service, systemd timer.

I was wondering of a use case that one can have a schedule to be backed up on external harddrive. And if the external drive is not always available, and the schedule was missed then the backup could start immediately when the drive is plugged. This is how backintime used to function.

I think its ok, users can use external tools like cron and systemd as you said. I saw the [systemd service](https://projects.torsion.org/borgmatic-collective/borgmatic/raw/branch/master/sample/systemd/borgmatic.service), [systemd timer](https://projects.torsion.org/borgmatic-collective/borgmatic/raw/branch/master/sample/systemd/borgmatic.timer). I was wondering of a use case that one can have a schedule to be backed up on external harddrive. And if the external drive is not always available, and the schedule was missed then the backup could start immediately when the drive is plugged. This is how backintime used to function.
Owner

Got it. Are you aware of the existing borgmatic support for occasional backups? That's intended to support a use case just like what you describe—a backup repository (or source directory) that's not always available. But it sounds like you'd like scheduling layered on top of that?

Got it. Are you aware of the existing borgmatic support for [occasional backups](https://torsion.org/borgmatic/docs/how-to/backup-to-a-removable-drive-or-an-intermittent-server/)? That's intended to support a use case just like what you describe—a backup repository (or source directory) that's not always available. But it sounds like you'd like scheduling layered on top of that?
witten added the
waiting for response
label 2023-03-27 03:20:59 +00:00
Owner

Just checking in again on this one. It sounds like you're wanting to go a little beyond scheduling capabilities in borgmatic and perhaps run it as a daemon process that waits until a configured removable drive is plugged in and then initiates a backup? I'm guessing that's because this is just more convenient than manually running borgmatic whenever the drive is plugged in?

Just checking in again on this one. It sounds like you're wanting to go a little beyond scheduling capabilities in borgmatic and perhaps run it as a daemon process that waits until a configured removable drive is plugged in and then initiates a backup? I'm guessing that's because this is just more convenient than manually running borgmatic whenever the drive is plugged in?
Author

I am satisfied with your previous reply and with the current reply. We can close this issue. Thank you.

I am satisfied with your previous reply and with the current reply. We can close this issue. Thank you.
witten removed the
waiting for response
label 2023-03-27 06:10:13 +00:00
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#616
No description provided.