Front page

obnam forget - keeping older backups and deleting the most recent

5a8dabbbeb2547d4a2a2cbdad489ed4d
ENLIST MICROSCOPE RHYTHM

From: Paulo Almeida <palmeida@igc.gulbenkian.pt>
Date: Wed, 21 Jun 2017 19:41:25 +0100

   Hi,
   
   I'm using obnam for my /home backup and due to a mistake in the
   excludes (forgot the commas when adding a couple of new directories), I
   backed up a lot of things I didn't want to, and the storage system ran
   out of quota. I would like to delete only the most recent backup, and
   keep everything else, but that doesn't seem to be possible with obnam
   forget's keep parameter. Is that right? If so, is there an alternative?
   Would it be feasible/desirable to add a '+' modifier to the keep
   parameter, like in the mtime of find, to only keep generations older
   than x and not more recent?
   
   The alternative I'm currently considering is to just delete the whole
   repository and start again, which in my case is not a big deal.
   
   In case it's relevant, I'm now using obnam 1.21 (since a few days ago,
   when I upgraded to Debian Stretch) and before that I was using the
   Debian Jessie version.
   
   Thanks,
   Paulo Almeida
   
   _______________________________________________
   obnam-support mailing list
   obnam-support@obnam.org
   http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-support-obnam.org
From: Lars Wirzenius <liw@liw.fi>
Date: Wed, 21 Jun 2017 21:59:29 +0300

   On Wed, Jun 21, 2017 at 07:41:25PM +0100, Paulo Almeida wrote:
   > Hi,
   > 
   > I'm using obnam for my /home backup and due to a mistake in the
   > excludes (forgot the commas when adding a couple of new directories), I
   > backed up a lot of things I didn't want to, and the storage system ran
   > out of quota. I would like to delete only the most recent backup, and
   > keep everything else, but that doesn't seem to be possible with obnam
   > forget's keep parameter. Is that right? If so, is there an alternative?
   > Would it be feasible/desirable to add a '+' modifier to the keep
   > parameter, like in the mtime of find, to only keep generations older
   > than x and not more recent?
   
   You can use "obnam generations" to list all generations, and make note
   of the generation ids (first column). Then run "obnam forget 1 2 3" to
   delete generations with ids 1, 2, 3. I hope that helps.
From: Alexander Batischev <eual.jp@gmail.com>
Date: Wed, 21 Jun 2017 22:02:24 +0300

   On Wed, Jun 21, 2017 at 07:41:25PM +0100, Paulo Almeida wrote:
   >I would like to delete only the most recent backup, and
   >keep everything else, but that doesn't seem to be possible with obnam
   >forget's keep parameter.
   
   I'm not entirely sure about `keep`, but I don't think you even need it.
   
   First, list all your generations with:
   
       $ obnam generations
   
   Suppose the number before the last line in the output is 123. You can 
   forget *just this particular generation* with:
   
       $ obnam forget 123
   
   Hope this helps.
From: Paulo Almeida <palmeida@igc.gulbenkian.pt>
Date: Thu, 22 Jun 2017 12:55:26 +0100

   Hi,
   
   Thanks Lars and Alexander for the quick replies. For some reason I
   skipped right to the 'keep' parameter in the documentation. After
   reading your suggestions I went back to the man page and the
   instructions for 'obnam forget' are quite clear, so I'm sorry for
   wasting your time. I'll only be able to test tomorrow, but I see no
   reason why it shouldn't work.
   
   Best,
   Paulo
   
   Am Mittwoch, den 21.06.2017, 21:59 +0300 schrieb Lars Wirzenius:
   > On Wed, Jun 21, 2017 at 07:41:25PM +0100, Paulo Almeida wrote:
   > > Hi,
   > > 
   > > I'm using obnam for my /home backup and due to a mistake in the
   > > excludes (forgot the commas when adding a couple of new
   > > directories), I
   > > backed up a lot of things I didn't want to, and the storage system
   > > ran
   > > out of quota. I would like to delete only the most recent backup,
   > > and
   > > keep everything else, but that doesn't seem to be possible with
   > > obnam
   > > forget's keep parameter. Is that right? If so, is there an
   > > alternative?
   > > Would it be feasible/desirable to add a '+' modifier to the keep
   > > parameter, like in the mtime of find, to only keep generations
   > > older
   > > than x and not more recent?
   > 
   > You can use "obnam generations" to list all generations, and make
   > note
   > of the generation ids (first column). Then run "obnam forget 1 2 3"
   > to
   > delete generations with ids 1, 2, 3. I hope that helps.
   > 
   
   _______________________________________________
   obnam-support mailing list
   obnam-support@obnam.org
   http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-support-obnam.org
From: Paulo Almeida <palmeida@igc.gulbenkian.pt>
Date: Fri, 23 Jun 2017 13:50:57 +0100

   I did run into a hitch while trying to delete generations. As I said in
   the original message, I exceeded the storage system quota while backing
   up. When I ran:
   
   obnam forget <generation>
   
   it attempted to create a temporary file (or directory) in the
   repository folder and it failed with "Disk quota exceeded". I saw in
   the man page that obnam accepts certain standard environment variables,
   so I tried:
   
   TMPDIR=/tmp obnam forget <generation>
   
   but that made no difference. I was going to ask my IT department to
   temporarily raise my quota, but I browsed a bit and found some old
   stuff I could delete. I'm running obnam forget now and already reduced
   usage from 155 GB to 152 GB with the first five generations (there are
   70+ checkpoints), so I expect the rest of the process to go well.
   
   As further reflection, I also tried to look in the manual for something
   that might give me the chunks of the relevant generations, so I could
   delete them manually, but of course that would involve making sure
   those chunks were not used for any other files. I suppose one
   alternative would be to copy the whole repository to another computer,
   run obnam forget pointing to that repository and then move it back to
   the storage server, but that would take a while. (I'm just thinking
   about what I could have done if I didn't have the option of deleting
   other files or raising the quota).
   
   Thanks,
   Paulo
   
   On Wed, 2017-06-21 at 21:59 +0300, Lars Wirzenius wrote:
   > On Wed, Jun 21, 2017 at 07:41:25PM +0100, Paulo Almeida wrote:
   > > Hi,
   > > 
   > > I'm using obnam for my /home backup and due to a mistake in the
   > > excludes (forgot the commas when adding a couple of new
   > > directories), I
   > > backed up a lot of things I didn't want to, and the storage system
   > > ran
   > > out of quota. I would like to delete only the most recent backup,
   > > and
   > > keep everything else, but that doesn't seem to be possible with
   > > obnam
   > > forget's keep parameter. Is that right? If so, is there an
   > > alternative?
   > > Would it be feasible/desirable to add a '+' modifier to the keep
   > > parameter, like in the mtime of find, to only keep generations
   > > older
   > > than x and not more recent?
   > 
   > You can use "obnam generations" to list all generations, and make
   > note
   > of the generation ids (first column). Then run "obnam forget 1 2 3"
   > to
   > delete generations with ids 1, 2, 3. I hope that helps.
   > 
   
   _______________________________________________
   obnam-support mailing list
   obnam-support@obnam.org
   http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/obnam-support-obnam.org
From: Alexander Batischev <eual.jp@gmail.com>
Date: Fri, 23 Jun 2017 21:25:09 +0300

   On Fri, Jun 23, 2017 at 01:50:57PM +0100, Paulo Almeida wrote:
   >As further reflection, I also tried to look in the manual for something
   >that might give me the chunks of the relevant generations, so I could
   >delete them manually, but of course that would involve making sure
   >those chunks were not used for any other files.
   
   I'd move a few chunks onto my local computer. That'd free a bit of 
   space, enough for obnam forget to run. And if it notices the missing 
   chunks and fails, hey, I can put them back and just re-run it.
   
   I'd also do obnam fsck afterwards, to make sure I didn't permanently 
   break anything.
   
   Dirty, but it'd probably work.