[Borgbackup] question regarding restoration of latest backup

Wojtek Swiatek w at swtk.info
Sat Sep 15 13:06:37 EDT 2018


To add to the answer, it is really worthwhile playing with pruning and
adapting what to keep with the risk profile.
As an example my backups are:

root at srv ~# borg list /services/backup/borg/
srv-2018-08-19T20:00:01+02:00        Sun, 2018-08-19 20:00:02
[ca918a240129e3ae4cd803da8d6b3de14434dff19b0324a9ad879bb4f9033623]
srv-2018-08-26T20:00:01+02:00        Sun, 2018-08-26 20:00:02
[d96c3b2590afdd088c051a20a604a52355ecd4db28abad6badf13e43666fea87]
srv-17dc7ba45cfd4b24a0df38154173c32d Sun, 2018-09-02 21:00:03
[7f295076d550bca2859b19d62f4670a576bd13ca84aa04d05d803978fd05d3ad]
srv-b88464c5db80445297375871a02add95 Thu, 2018-09-06 21:00:04
[896c6bde242a16c35e5894e134c188da8a6d515be3e905f347b20c67d28b51f4]
srv-33529fc25c84499e98646de6a555fd2a Fri, 2018-09-07 21:00:04
[f331440738cba678f2ccb0c81a00731e442de24e1ba0d75ecb4f8fa7fb6de8fc]
srv-0cec869710d74ad4b005148c9147a8e3 Sat, 2018-09-08 21:00:04
[d57e5d45addee30caef21e8a47827c788d2c3cb717b9f1a5c0e3c68598f9c55a]
srv-05df149848c84f32bc3c135c567af7f4 Sun, 2018-09-09 21:00:04
[306a3fceb9588898e134461fd08ee912231fa05782865fad56b1ddc2d7c802a9]
srv-e59d0df80d6d475a8152686ee6f002de Mon, 2018-09-10 21:00:04
[e2bbff2175f7d6fe16e53eab0894f3ce7ff4341448e26cb0226c2fb0e833d95e]
srv-7cd6f3105fcd4d88849a4a31aac0ca1a Tue, 2018-09-11 21:00:11
[e42fcb84d022992be275a3dcd39c073142100c727dcc9a38c2b4ff5505004f95]
srv-349a31f6044144dea02ce94c298c3341 Wed, 2018-09-12 18:00:05
[6609c5784e0278c06b518933ebcc6acfabfff1773060c395adcfcb62b5c69e6c]
srv-494092c323e44b508492c2946c2a2c31 Thu, 2018-09-13 21:00:04
[73b788010bdbc197c29d170f86d745f057a4fcda263d957e048bb6d3dbc09a85]
srv-58a00dacf6d54cbaa88a23650cd1bb25 Fri, 2018-09-14 00:00:04
[a6e5ff1d0d39941cbf7251bc8f4ba8c0b4a2f8b9801a543ad289a734475fc632]
srv-52190f860bdb4f998dc3ef79a64afb72 Fri, 2018-09-14 03:00:04
[48b9e845815c2dd743eec34d16c24aaed85db54b9a9ca629a3e3fc5790f381a1]
srv-0b84d425148e404ab59f15c0fdb016d6 Fri, 2018-09-14 06:00:04
[7bde1c378da76f286c1757533ceddf3277c5c3cf6ff9a6f986e4ed7746db5ca8]
srv-2b60fb979b60462f93847713c244d0f0 Fri, 2018-09-14 09:00:04
[939d08f6aa6bd06117238730d0a5536e8a7cd82ebcf8023a8c9708f351ef41fd]
srv-83e0f05e1a4d4926a0a7a1c6e5e2a318 Fri, 2018-09-14 12:00:03
[2513500d9d3d8b0350257315cb6babaa898437ffa89501190e6761dd245cdb1e]
srv-4904f197c6a9411aa19cf85bf0c00e15 Fri, 2018-09-14 15:00:04
[09ba0e56e0fe87cbc1461cf0e026995a3b30d45b67420a8f641d81d015e27d33]
srv-aa9a11d50f42416082866742a256d977 Fri, 2018-09-14 18:00:04
[2cbae32e80d85d5fb5bf37176e02ddc1e0c3d0dc16dac3c3110a965a25f1bf87]
srv-886a0874e3ba45b0818e8601387358bc Fri, 2018-09-14 21:00:04
[ff7b345ece86836996beee1d38aab850964bb779f9084373ecd1e290ab35da3e]
srv-b6ae75535c9249e9810a13aee64261ec Sat, 2018-09-15 00:00:04
[75f9462c01f86c6220220b99dfb018f171a52e213cd53fab9505b3e127e427ca]
srv-b41bcb1e914e4c7a9afee0d0cc161664 Sat, 2018-09-15 03:00:05
[8ace767e7c1abb707e0d7f4e1d976a24c89c0336b211976ef564d11360a51e33]
srv-68384133c1ce45ad96c02e2a52906e8a Sat, 2018-09-15 06:00:05
[3c8a2153c217e6c03478772db4cc2a01f6a3ff3910c785c50efe9016922f5445]
srv-d2083d432b9243bf89d314bb2fc65c54 Sat, 2018-09-15 09:00:04
[b889dc2da68870f38a11c06e4592806935ea9f192b5dffbec3190825cbbd9f32]
srv-5042ecd186114756bd0f80f9b19817d5 Sat, 2018-09-15 12:00:04
[5019f92147664d28c0257a75cfefef6c3574e4bf3a409bc2b20f42e9a783c9b0]
srv-f51711db800a449598c5821b5266c240 Sat, 2018-09-15 15:00:04
[be67fa17f2c3c3ce391ee2c6d77207f8279f1a04c33ed1a332733c44e18d562c]
srv-06eeec8d2fd641d39ea2c675532f4c79 Sat, 2018-09-15 18:00:04
[3411dda838b3be3bf3e5433bc55a3ef476d5bee289628ced8cc175a7dfc8cdfd]

They follow a scheme of --keep-daily=7 --keep-weekly=4 --keep-within 2d
(enforced by pruning them)
The idea is that
- the 4 weeklies are "just in case", I will never need them since I make
many changes in my chaotic system but, in case I remember I want something
in a span of a month it will be there
- the dailies are to have 7 days of  backups, one per day
- the "keep within 2 days" is to keep all backups I make within two days
(they are started every 3 hours)
As you can notice, I changed the naming scheme in the meantime and will
need to wait ~two more weeks for the old one to be gone.

In my risk profile, this allows to have a continuity of backups to recover
from bad ideas for 2 days almost continuously (3 hours), then recover from
possibly
less bad ideas every day (for 7 days) and then from even less bad ideas a
few times more, across a month.
"Bad ideas" here mean some things I did and ended up not being the right
ones to do.

What is fantastic with borg is that this schedule actually does not matter
for the backup. I could backup every 10 minutes and nothing would change
(just more backups kept) - except that the machine would be backing up
continuously.
Disk wise it does not matter much in my case (the changes are small, if any)

I could remove, say, srv-d2083d432b9243bf89d314bb2fc65c54 form today and I
would have the data from srv-68384133c1ce45ad96c02e2a52906e8a
and then srv-5042ecd186114756bd0f80f9b19817d5

I find that backing up "often" is the solution, and then follow the backup
with a prune to actually keep what is needed works best for me

Cheers,
Wojtek



Le sam. 15 sept. 2018 à 18:39, Christian <abelschreck3 at freenet.de> a écrit :

> Hi Marian,
>
> thanks again for your answer.
>
> Now I get it. That´s really fantastic.
> I just tried it out by adding a new file to the original folder, then
> backing it up and deleting the first backup.
> And indeed the second backup holds all data including the newly created
> one.
>
> borgbackup is really a wonderful programme. Now that I know how it works
> I like it even better.
>
> Thanks again for your fast help.
>
> Have a nice weekend.
>
> Greetings.
> Rosika
>
> Am 15.09.2018 um 17:57 schrieb Marian Beermann:
> > Yes, that's indeed the case.
> >
> > Each archive can be independently manipulated from every other archive.
> > Borg recognizes duplicate data (e.g. from Monday and Tuesday) backups
> > and stores it only once; deleting Monday will not delete any data still
> > used by Tuesday.
> >
> > -Marian
> >
> > On 9/15/18 5:48 PM, Christian wrote:
> >> Hi Marian,
> >>
> >>
> >> thank you so much for your fast answer.
> >>
> >> Yet it´s not quite clear to me how it works.
> >>
> >> Referring to my example: Do you say that I can delete the Monday-backup?
> >> That would imply that all the data of the Monday-backup is present in
> >> the Tuesday-backup as well.
> >>
> >> I was of the opinion that the Tuesday-backup only holds the new data. Or
> >> did I get it wrong?
> >>
> >> Greetings
> >> Rosika
> >>
> >>
> >>
> >> Am 15.09.2018 um 17:37 schrieb Marian Beermann:
> >>> You don't have to think about any of that.
> >>>
> >>> You can create an archive.
> >>> You can extract it.
> >>> Deleting other archives makes no difference.
> >>>
> >>> -Marian
> >>>
> >>> PS: That's the trade-off made by Borg and similar software. Requires
> >>> more CPU and memory resources, but gets rid of inter-backup
> dependencies.
> >>>
> >>> On 9/15/18 5:27 PM, Christian wrote:
> >>>> Hi altogether,
> >>>>
> >>>> I´ve got a question regarding restoration of backups.
> >>>>
> >>>> I looked at
> https://borgbackup.readthedocs.io/en/stable/quickstart.html
> >>>> for information. But somehow I couldn´t find what I was looking for.
> >>>>
> >>>> Out of sheer interest:
> >>>>
> >>>> Suppose I created a backup with "borg create /path/to/repo::Monday
> ~/src
> >>>> ~/Documents" .
> >>>> And the next day: "borg create --stats /path/to/repo::Tuesday ~/src
> >>>> ~/Documents" .
> >>>>
> >>>> It says: "This backup will be a lot quicker and a lot smaller since
> only
> >>>> new never before seen data is stored."
> >>>>
> >>>> O.K., I understand. But what if I wanted to restore the latest backup
> >>>> (the "Tuesday" one)?
> >>>> Since this one only holds the new data I suppose I´d have to keep the
> >>>> "Monday" backup, too.
> >>>>
> >>>> But what would be the correct command? Would it be  "borg extract
> >>>> /path/to/repo::Tuesday" ?
> >>>> After all I want to retore the latest backup.
> >>>> Would "borg extract /path/to/repo::Tuesday"  take care of the "Monday"
> >>>> backup automatically since the bulk of the data is stored there?
> >>>>
> >>>> Thanks a lot for your help.
> >>>>
> >>>> Greetings
> >>>> Rosika
> >>>>
> >>>> _______________________________________________
> >>>> Borgbackup mailing list
> >>>> Borgbackup at python.org
> >>>> https://mail.python.org/mailman/listinfo/borgbackup
> >>>>
> >
>
> _______________________________________________
> Borgbackup mailing list
> Borgbackup at python.org
> https://mail.python.org/mailman/listinfo/borgbackup
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/borgbackup/attachments/20180915/ccb10170/attachment-0001.html>


More information about the Borgbackup mailing list