From: Holger P. <wb...@pa...> - 2007-01-28 03:57:30
|
Hi, Matteo Barbieri wrote on 16.01.2007 at 15:46:47 [[BackupPC-users] Filter by file type]: > [...] > I have to backup some Win Laptops, but I only want to save some file types. > So i set $Conf {BackupFilesOnly} to '*.doc', but backuppc saves only > word files that are in the "root" of the module (setting it to '*/*.doc' > saves only files on a subdirectory). > Is there a way to save only files with certain extensions recursively? I'll assume you're using rsync(d) as transfer method, because that's the case I'd like to answer. >From looking at the BackupPC code and one or two rsync man pages, I'd expect the following to work. Leave $Conf{BackupFilesOnly} empty and add the following elements at the *end* of the $Conf{RsyncArgs} array: '--include=*/', '--include=*.doc', '--exclude=*', (meaning: include any directories anywhere in the tree (not the files in them, just the directory skeleton), include any doc files, exclude any other files). These patterns are adopted from rsync's man page, making them likely to actually work. I can't see any trick to make $Conf{BackupFilesOnly} do what you want, but you can use $Conf{BackupFilesExclude}, even if that sounds paradoxical. $Conf {BackupFilesExclude} = [ '+ */', '+ *.doc', '*' ]; See the rsync man page for details on why that should work. Regards, Holger |