BackupPC-users

Re: [BackupPC-users] How to delete specific files from backups? (with BackupPC_deleteFile.pl)

2011-05-23 11:31:39
Subject: Re: [BackupPC-users] How to delete specific files from backups? (with BackupPC_deleteFile.pl)
From: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Mon, 23 May 2011 11:29:37 -0400
Holger Parplies wrote at about 16:28:06 +0200 on Monday, May 23, 2011:
 > Hi,
 > 
 > Nick Bright wrote on 2011-05-22 23:27:58 -0500 [Re: [BackupPC-users] How to 
 > delete specific files from backups? (with BackupPC_deleteFile.pl)]:
 > > On 5/22/2011 7:14 PM, Nick Bright wrote:
 > > > Sounds to me like the BackupPC_deleteFile script is the way to go:
 > > [...]
 > > No matter what options I give it, it just won't delete anything.
 > > 
 > > There is a complete void of examples, and there is no indication of what 
 > > valid inputs are for the arguments are in the documention, so I'm not 
 > > even sure if I'm doing it correctly.
 > 
 > Jeffrey? ;-)
I responded :)
 > 
 > > I've tried:
 > > 
 > > BackupPC_deleteFile.pl -h hostname -n - -d 4 /var/log/maillog
 > > [...]
 > > 
 > > But they all just give the same output - nothing deleted.
 > 
 > >From that example, the general syntax of the BackupPC_* commands provided 
 > >with
 > BackupPC, and the expectation that Jeffrey will follow their conventions,
 > I'd expect you need to provide a '-s <sharename>' argument and probably
 > the path within this share as either relative or absolute path. So, if you
 > have a share '/var', that would be
 > 
 >      BackupPC_deleteFile.pl -h hostname -n - -d 4 -s /var /log/maillog
 > 

Correct if /var is the share or if '/' is the share then it would be
-s '/' or alternatively -s %2f (which is how it is encoded in your pc
directory). Note for /var as the share you could also use the %2fvar
encoding.

For the file/directory names, the default is to use mangled paths so
you would need to write /flog/fmaillog unless you use the '-m' flag to
accept unmangled paths in which case /var/log/maillog works fine. The
leading / is optional. 

If using mangled paths then as a special case you can avoid using the
share name if you use the full *mangled* and encoded path from root
which in this case would be:
         f%2f/fvar/flog/fmaillog

> (don't know what '-d 4' does, though; aside from that, where did you get
> '-n -' from? Maybe try '-n -1'?).

structure of incremental backup dependen
The '-' allows for a range of backup numbers. Say '20-35' and
extending that convention:
                   '-35' is all backups up to 35 inclusive
                   '20-' is all backups from 20 and on
                   '-' is all backups
Then by extension for consistency, '-' is also used as the wildcard
for host names and share names. Note using '*' as a wildcard is not a
good idea since it would need to be quoted to prevent the shell from
interpreting it.

The '-d' specifies debugging levels so for example you can see what
exact hosts/shares/backups are being searched and so you can see the
hierarchy of incrementals and what exactly is being deleted/moved
etc. to preserve the inheritance based on the specific backup numbers
you want deleted. It also allows you to see what attributes are erased
vs. marked as type=deleted etc.

 > You probably have a share '/', so it would be '-s / /var/log/maillog' or
 > '-s / var/log/maillog' instead. It really depends on how you set your
 > backups up, because that determines how BackupPC stores them.
 > 
 > But I'm just guessing.
You guessed right.

 I'd look at the script, but I don't really have the
 > time right now. Wait for an authoritative answer if you don't feel like
 > experimenting (but you probably do - you've already done so ;-).
 > 
 > Hope that helps.

I'm sure it helped him, but I just filled in a little more.

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
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/