Wolfgang Karall writes:

> I'm having a slight problem with the exclude patterns for tar, and
> having searched the archives without result (sf.net's archive never
> turns up much for me...), I figured I just ask. I'm using version
> 2.1.0pl1, so if this has been fixed in a later version, just tell me and
> I'll upgrade. (haven't found anything relevant in the ChangeLog either,
> btw)
> 
> I'm using tar to backup the machine backuppc itself, setup according to
> the FAQ entry using sudo, the tarCreate helper scripts etc. Everything
> works fine apart from one thing, the exclude patterns.
> 
> So, problem is, tar patterns don't behave the same way when doing full
> and incremental backups. With incremental backups something like
> 
> $Conf{BackupFilesExclude} = [ '/proc/*' ];
> 
> works, tarCreate and hence tar is run with (from XferLOG, and ps ax also
> show the same command line at the time of backup)
> 
> /usr/bin/sudo /usr/local/sbin/tarCreate -v -f - -C / --totals
> --newer=2005-09-13 20:16:44 --exclude=./proc/* .
> 
> but when a full backup is run the pattern gets escaped and is run as
> 
> /usr/bin/sudo /usr/local/sbin/tarCreate -v -f - -C / --totals
> --exclude=./proc/\* .
> 
> that pattern then doesn't match, hence /proc gets backed up.
> 
> BTW, /proc is just an example, because I try to use the same pattern
> '/path/to/dir/*' for other directories as well with the same result. I'm
> doing this because I want the directories themselves in the backup (so
> that I don't have to manually mkdir the /proc mountpoint at restore time
> for example), but not the contents of the directories.
> 
> Any ideas? (if you need information from the config files, I'll be happy
> to provide them)

BackupPC escapes shell characters when it runs the tar command
since the command arguments are passed through one (eg: sudo)
or two shells (eg: ssh to a remote host).

For a local backup it needs to escape the arguments one less
time, since there is one less shell used.

That's indicated with the "+" appended to the fileList
argument in $Conf{TarIncrArgs} and $Conf{TarFullArgs}, eg:

    $Conf{TarIncrArgs} = '--newer=$incrDate+ $fileList+';
    $Conf{TarFullArgs} = '$fileList+';

>From the commands you list above I suspect you have just
"$fileList" in $Conf{TarIncrArgs} and "$fileList+" in
$Conf{TarFullArgs}.

Craig


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to