SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
exclude bug when working with older versions of GNU tar
Author Message
Post exclude bug when working with older versions of GNU tar 
I found an interesting problem today when backing up machines use the
'tar' method and having GNU tar version 1.12 or older installed on the
remote machines.

My config file looked like this:

$Conf{XferMethod} = 'tar';
$Conf{TarClientPath} = 'env PATH=/usr/local/bin:/usr/bin:/bin tar';

$Conf{BackupFilesExclude} = [
'/proc',
'/tmp',
'/home',
'/build'
];

I backup of very diverse build cluster or many different
architectures. Most are backup up with rsync, but some or too old or
too strange for rsync to build correctly, so I revert to tar.

I found that BackupPC reverts the BackupFilesExclude config to the
following options on the command line:

tar -cvf - -C / --exclude './proc' --exclude './tmp' .

But tar doesn't put a './' at the start of the pathnames to backup.
With GNU tar version 1.13 this command line seems to work correctly,
but with older versons the excludes don't match anything.

Hmm. I just noticed the documentation:

You must have GNU tar on the client machine. Use ``tar --version'' or
``gtar --version'' to verify. The version should be at least 1.13.7,
and 1.13.20 or greater is recommended. Tar is run on the client
machine via rsh or ssh.

Any chance that could be autodectected? Maybe run a
'ssh -l root $host $tar --version' before running the actual backup?
Is there are header in the tar file? (maybe with the gnu format)

I will go ahead and send this email just incase it help someone when
searching the archives.

Also does rsync send the version number in its protocol?

-Wayne


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post exclude bug when working with older versions of GNU tar 
Wayne Scott writes:

I found an interesting problem today when backing up machines use the
'tar' method and having GNU tar version 1.12 or older installed on the
remote machines.

My config file looked like this:

$Conf{XferMethod} = 'tar';
$Conf{TarClientPath} = 'env PATH=/usr/local/bin:/usr/bin:/bin tar';

$Conf{BackupFilesExclude} = [
'/proc',
'/tmp',
'/home',
'/build'
];

I backup of very diverse build cluster or many different
architectures. Most are backup up with rsync, but some or too old or
too strange for rsync to build correctly, so I revert to tar.

I found that BackupPC reverts the BackupFilesExclude config to the
following options on the command line:

tar -cvf - -C / --exclude './proc' --exclude './tmp' .

But tar doesn't put a './' at the start of the pathnames to backup.
With GNU tar version 1.13 this command line seems to work correctly,
but with older versons the excludes don't match anything.

Hmm. I just noticed the documentation:

You must have GNU tar on the client machine. Use ``tar --version'' or
``gtar --version'' to verify. The version should be at least 1.13.7,
and 1.13.20 or greater is recommended. Tar is run on the client
machine via rsh or ssh.

Any chance that could be autodectected? Maybe run a
'ssh -l root $host $tar --version' before running the actual backup?
Is there are header in the tar file? (maybe with the gnu format)

There isn't a header in the tar file. Auto-detecting would be a lot
of work just to support an ancient version of tar. Can you upgrade
to tar 1.13.x?

If not, simply leave $Conf{BackupFilesExclude} empty (or undef) and
hardcode $Conf{TarClientCmd} as you need, eg:

$Conf{TarClientCmd} = '$sshPath -q -n -l root $host'
. ' $tarPath -c -v -f - -C $shareName+'
. ' --totals --exclude /proc --exclude /tmp';

I'm not sure that BackupPC will be 100% happy about not seeing the
leading "./" on each file when it unpacks the tar archive.

Alternatively, look see if tar 1.12.x has an option for relative
path names. In 1.13.x, relative pathnames are the default, and
the --absolute-names option makes the paths absolute.

Also does rsync send the version number in its protocol?

Yes.

Craig


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post exclude bug when working with older versions of GNU tar 
From: Craig Barratt <cbarratt < at > users.sourceforge.net>
There isn't a header in the tar file. Auto-detecting would be a lot
of work just to support an ancient version of tar. Can you upgrade
to tar 1.13.x?

Of course. I have a workaround and will probably just upgrade tar on
those machines.

I was just suggesting that it would be great if BackupPC could have
detected the version incompatibility for me and refused to do the
backup. I think that might not be too hard with rsync if it sends
version information.

Thanks for your efforts,

-Wayne

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB