BackupPC-users

Re: [BackupPC-users] Stop TrachClean / Return directories backup list

2013-03-20 15:36:31
Subject: Re: [BackupPC-users] Stop TrachClean / Return directories backup list
From: <backuppc AT kosowsky DOT org>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Wed, 20 Mar 2013 15:35:08 -0400
Holger Parplies wrote at about 19:56:26 +0100 on Wednesday, March 20, 2013:
 > Hi,
 > 
 > Phil Kennedy wrote on 2013-03-20 12:37:10 -0400 [[BackupPC-users] Stop 
 > TrachClean / Return directories backup list]:
 > > Hi,
 > > I recently had a somewhat odd system failure (poorly configured software 
 > > RAID) that lead to a *very* old set of BackupPC config files being 
 > > loaded. On one windows machine (possibly more), the default SMB share 
 > > was reset to C$ instead of E$. The full count keep, plus the min keep 
 > > values were also set lower than we wanted them. BackupPC naturally 
 > > marked all the old E$ directories as trash, and has removed them from 
 > > the browse backup list.
 > > 
 > > The good news (besides the fact that the previous admin of this box is 
 > > several states away and out of arms reach....) is that the backup 
 > > directories and their data still exist under the 
 > > /var/lib/backuppc/pool/hostname/backup number/ directory.
 > 
 > You probably mean "pc", not "pool".
 > 
 > > They just don't show up when you browse the backups.
 > 
 > First of all, let's imagine what happens in the case you described.
 
 > 2.) The history settings (FullKeepCnt, IncrKeepCnt, etc.) are changed.
 >     => On the next invocation of BackupPC_dump (with the correct options) for
 >        the host, normally on the next backup *attempt*, backups will be 
 > expired
 >        as defined by the new settings. This means that all backups no longer
 >        to be kept will be moved to $TopDir/trash. As I read the code, they
 >        will get a name consisting of time, process id, and counter. That 
 > means
 >        you will have a hard time identifying where they came from (because
 >        neither host name nor backup number will be visible any longer). The
 >        modification date of the subdirectories might give you a hint
 >        concerning the order they belong in. 

You should be able to completely recreate the numbering plus the info
in the 'backups' file using the backupInfo file. Indeed, I believe the
plaintext hash that it represents includes all the necessary fields:
  'noFill'
  'nFilesNew'
  'num'
  'size"
  'endTime'
  'fillFromNum'
  'xferErrs'
  'xferMethod'
  'startTime'
  'sizeNewComp'
  'mangle'
  'version'
  'nFilesExist'
  'charset'
  'tarErrs'
  'xferBadShare'
  'sizeExist'
  'level'
  'nFiles
  'compress'
  'sizeExistComp'
  'type'
  'xferBadFile'
  'sizeNew'


 >        Note, though, that BackupPC_trashClean will become active by
 >        default every 5 minutes and delete everything in
 >        $TopDir/trash. You can increase the interval by setting
 >        $Conf {TrashCleanSleepSec}, but you should note that upon
 >        startup trashClean will empty the trash once before
 >        sleeping.  You should be able to protect items already in
 >        the trash by setting permissions accordingly. trashClean
 >        just tries to unlink/rmdir the items, so if you 'chmod a=
 >        ...' a non-empty directory, it will simply fail and leave
 >        the directory where it is (for a file, this would obviously
 >        not work). Revoking write permission on $Topdir/trash itself
 >        should also stop trashClean, but I believe the code moving
 >        things there in the first place would then resort to
 >        deleting the trees instead.

Yes - anything not moved will be deleted directly by RmTreeDefer
 > > 2. How can I tell TrashClean to take a couple days vacation while I sort 
 > > out the consistency of other 130 machines?
 > 
 > Well, as I said, you could set $Conf {TrashCleanSleepSec} to a high value, 
 > but
 > the point really is that you want to avoid the backups being trashed in the
 > first place. What I'd probably do is stop BackupPC completely while I sort
 > things out. Presuming that is not possible, I'd set $Conf {BackupsDisable} = 
 > 2
 > in the main config.pl to disable all backups by default, and then re-enable
 > them one by one for each host I have checked and corrected in the host.pl 
 > file.
 > Note that I have not tested this. Perhaps someone could confirm that backups
 > are not expired for hosts with BackupsDisable'd ...

Note that BackupPC_dump code has the following
usage comment:
#     -e   Just do an dump expiry check for the client.  Don't do anything
#          else.  This is used periodically by BackupPC to make sure that
#          dhcp hosts have correctly expired old backups.  Without this,
#          dhcp hosts that are no longer on the network will not expire
#          old backups.

So, expiry is still called even if Backups are disabled... however,
the code for BackupPC_dump seems to exit before expiry if
BackupsDisable == 2 so you should be ok... but I would check/test as
Holger suggests...

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/