FW: Expanding the include/exclude options

Jason Piterak Jason_Piterak@c-i-s.com
Thu, 28 Mar 2002 11:30:08 -0500


 Hi Ben,
   Seeing as I was the miscreant that asked you for this 
 feature in the first place, I figure I ought to take a stab 
 at some ideas...
 
   I think both of your criticisms are right on... It WOULD be 
 complicated, and probably not flexible enough... 
   What if, instead, you simply allowed rdiff-backup to 
 receive a file list from <stdin>, so that you could use find 
 or ls+glob+grep or locate or a cat a file or run a perl 
 script... or whatever to pass you a completed file/dir list. 
 It seems there's no sense recreating the wheel if there are 
 already tools out there that we use to do this.
   ...so how about something like:
 
     <call to file selection command/script>|rdiff-backup 
 --exclude <any additional exclusions> 
 dest_username@dest_host::dest_path
 
   One problem with this comes when you have issues with the 
 same source filenames clobbering each other at the 
 destination. You could add a clobber/noclobber switch.
   Another problem is wanting multiple destination 
 directories/locations... I would say just deal with that with 
 another rdiff-backup call.
 
   The main idea was to allow for complicated selection of 
 files from one host, and to backup those files to another 
 host using a single ssh session.
   I'm sure I'm missing stuff... You're usually pretty good at 
 picking out potential problems ;-)
 
   What do you all think?
 
 --JP
 
 ---
 Jason Piterak
 System Architect
 CIS Technical Services
 33 Main St., Suite 302
 Nashua, NH 03064
 (603) 889-4684 - FAX (603) 889-0534
 
 
> 
> > -----Original Message-----
> > From: rdiff-backup-admin@keywest.Stanford.EDU
> > [mailto:rdiff-backup-admin@keywest.Stanford.EDU]On Behalf Of 
> > Ben Escoto
> > Sent: Thursday, March 28, 2002 3:04 AM
> > To: rdiff-backup@keywest.Stanford.EDU
> > Subject: Expanding the include/exclude options
> > 
> > 
> > 
> > One request I got a long time ago was for better include/exclude
> > options.  So, how about this system:
> > 
> > --exclude xxx works the same way it does now
> > 
> > --include xxx means include the files satisfying reg. expression xxx
> > 
> > When there are muliple exclude and includes, the order
> > matters, so that, for instance
> > 
> > --exclude /foo/.* --include /foo/bar --include /foo/baz
> > 
> > would mean to backup /foo/bar and /foo/baz, but not any of the other
> > files or directories in /foo.
> > 
> > 
> >     Now, one problem a user might have is to backup all their .doc
> > files, but they don't know which directories their .doc 
> files would be
> > in.  For this, we can add the --include-dirs option, which 
> means that
> > all directories should be included, so the user could try:
> > 
> > --exclude .* --include-dirs --include .*\.doc
> > 
> > This means go through and back up all the directories, but 
> exclude all
> > the ordinary files, except the ones ending in .doc.  Some extra
> > options could be added as abbreviations, so that the above 
> could also
> > be written:
> > 
> > --exclude-all --include-dirs --include .*\.doc
> > 
> > or even
> > 
> > --exclude-all-except-dirs --include .*\.doc
> > 
> > 
> >     Another old request is to accept a list of files.  
> There could be
> > options --exclude-from-filelist or --include-from-filelist, so that
> > 
> > --exclude .* --include-from-filelist listing.lst
> > 
> > would only back up the files listed in listing.lst, and
> > 
> > --exclude-from-filelist listing2.lst --include .*\.doc
> > 
> > would back up everything except for the files listed in 
> listing2.lst,
> > but also files ending in .doc, whether or not they where 
> listed in the
> > file.  And maybe if the filename were '-' or something like that,
> > rdiff-backup could read stdin instead of a file on disk.
> > 
> > 
> >     So comments/suggestions about this system?  It would be 
> backwards
> > compatible with the current --exclude system but expand what was
> > possible.  Two possible criticisms:
> > 
> > 1.  It is too complicated, and constructions like
> > 
> >     --exclude-all --include-dirs --include .*\.doc
> > 
> >     are needlessly counterintuitive when "all I want to do 
> is back up
> >     my .doc files."
> > 
> > 2.  It is not complicated/flexible enough.  For instance, 
> the find(1)
> >     command allows logical expressions to be combined using 
> -and, -or,
> >     and -not.  This system would make it hard to backup "the device
> >     files that matched this expression, unless they were in that
> >     directory, in which case, etc...."
> > 
> > 
> > --
> > Ben Escoto
> > 
>