I've got a number of backups as tar archives, and to do checking/testing of them I restore to some test machines using:

cat archive.tar.gz | ssh server2 "cd /path/to/dir; tar zxvf -"

Most of the target machine is the same, so this ssh/tar piping is overkill in bandwidth, time and disk access. Is there any way of piping through rsync to compare the contents of the tar file with the target server?

Edit: Forgot to say, I'm Using RHEL6

  • 1
    Well, the obvious method is to untar it, run rsync on the directory tree, and tar it again. Depending on the size, you might be able to do it in a tmpfs for better speed.
    – Tom Hunt
    Commented Dec 2, 2015 at 16:29
  • 1
    There's also archivemount, which might be better than explicitly untarring it.
    – Tom Hunt
    Commented Dec 2, 2015 at 16:30
  • The resources on the target machine are limited, and the backup size is large - 20-30gb. You mentioning the tmpfs means I might be able to mount the tar archive...
    – KolonUK
    Commented Dec 2, 2015 at 16:34
  • and you beat me to it! I'll check out archivemount...
    – KolonUK
    Commented Dec 2, 2015 at 16:35

1 Answer 1


Well, the only answer I can find is to mount the archive using ArchiveMount, then rsync against that. I had to manually install it using an RPM as it's not in the Redhat 6 repositories.

No wasted space on the backup or test machines to unpack, though it does take a good few minutes to mount a 30gb archive, I guess because it has to read all the files in the archive and create a directory structure - not looking forward to the 200gb archive I've got!

Anyway, seems to run fast enough, though not done any real stats.

Thank Tom!

  • For those interested, we now do backups with hard links instead. This compromises between the wasted compressed space for files that don't change, and larger consumed space for files that do change. The benefit for us is that every backup is unpacked and ready to go, rather than having to find space to unpack the archive before using it...
    – KolonUK
    Commented Jan 5, 2018 at 12:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .