Allow checking the repository more rarely #150

Closed
opened 2019-03-11 22:51:49 +00:00 by skorokithakis · 5 comments

Checking a repository takes much, much longer than the actual backup. Personally, I only need to check the repository about once a month, and not every time I create a backup.

Would it be possible to configure Borgmatic to run the check only once every X days or something like that? It could even be stateless, like "run every Monday"/"run every 3rd of the month", etc.

Checking a repository takes much, much longer than the actual backup. Personally, I only need to check the repository about once a month, and not every time I create a backup. Would it be possible to configure Borgmatic to run the check only once every X days or something like that? It could even be stateless, like "run every Monday"/"run every 3rd of the month", etc.
Owner

You can run checks completely independently from backups if you like! The idea is that you could put borgmatic --create --prune in a frequent cron job and then put borgmatic --check in a less frequent job.

Please have a look at these docs and let me know if any of the options there work for your use case:

https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/

If not, please let me know a few more details about what you'd like to see. Thanks.

You can run checks completely independently from backups if you like! The idea is that you could put `borgmatic --create --prune` in a frequent cron job and then put `borgmatic --check` in a less frequent job. Please have a look at these docs and let me know if any of the options there work for your use case: https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/ If not, please let me know a few more details about what you'd like to see. Thanks.
Author

Ah, yes, of course. I missed that page completely and didn't realize I could only run some of the steps.

I would slightly prefer it if Borgmatic did the right thing with one invocation, but that preference isn't worth the hassle of its implementation. I will split the steps like the page details, thank you!

Ah, yes, of course. I missed that page completely and didn't realize I could only run some of the steps. I would slightly prefer it if Borgmatic did the right thing with one invocation, but that preference isn't worth the hassle of its implementation. I will split the steps like the page details, thank you!
Author

The only issue I see is the following:

I have backups scheduled every day at 4 am and a check on the first of the month at 5 am. If the backups aren't complete by then, the check won't run until next month, so it might be many months if the situation is unlucky enough.

Borgmatic has the luxury of knowing when the backup is done, and could schedule the check more effectively. Other than that, both cases are of identical usefulness.

I'll see if I can schedule a task to run with check on the first of the month and one with prune/backup/check on every day EXCEPT the first.

The only issue I see is the following: I have backups scheduled every day at 4 am and a check on the first of the month at 5 am. If the backups aren't complete by then, the check won't run until next month, so it might be many months if the situation is unlucky enough. Borgmatic has the luxury of knowing when the backup is done, and could schedule the check more effectively. Other than that, both cases are of identical usefulness. I'll see if I can schedule a task to run with check on the first of the month and one with prune/backup/check on every day EXCEPT the first.
Author

This seems reasonable to me, how does it look to you?

0 7 2-31 * * /home/stavros/.local/bin/borgmatic --prune --create > /dev/null 2>&1
0 7 1 * * /home/stavros/.local/bin/borgmatic --prune --create --check > /dev/null 2>&1
This seems reasonable to me, how does it look to you? ``` 0 7 2-31 * * /home/stavros/.local/bin/borgmatic --prune --create > /dev/null 2>&1 0 7 1 * * /home/stavros/.local/bin/borgmatic --prune --create --check > /dev/null 2>&1 ```
Owner

Sorry, I apparently didn't see the ticket notification for this until now. Yes, that looks totally reasonable to me. Nice solution!

Sorry, I apparently didn't see the ticket notification for this until now. Yes, that looks totally reasonable to me. Nice solution!
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#150
No description provided.