Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to upgrade a Server and there have to make a compressed backup of a lot of directories. The question is: Which format should I use? tar.gz, cpio? Both compression and decompression processes should be fast. In case I have some corruption on the Server later on, I want to be able to easily pick certain files out of my old backups.

Thanks, Philip

share|improve this question
It depends on what you mean by "easily", and how much space you have available on your archive media. – voretaq7 Jan 14 '11 at 16:28
By easily I mean: Specify the file/directory I want to restore and get it restored in a reasonable amount of time. I plan to use another computer as backup medium via sshfs, smb or ftp. There I'll have around 150 GB which should suffice for a compressed backup of the important data. – Philip Jan 14 '11 at 18:15
up vote 1 down vote accepted

Good old standard tarballs allow for the extracting of a single file. For more detailed information, I would recommend you read the man page for tar. But, to get you started, here's a quick example :

# List content of a gzip compressed tar file
tar -tzf tarball.tgz
# Extract all contents of the gzip compressed tar file
tar -xzf tarball.tgz
# Extract filename from the gzip compressed tar file
tar -xzf tarball.tgz filename
# Extract filename*, same as above but from any directory within the tarball and using pattern expansion. 
tar -xzf --wildcards --no-anchored 'filename*'
share|improve this answer

You could use a read-only file system like squashfs. This will also compress the files. The advantage over tar, cpio is that getting a specific file is instant.

Another alternative is to use 7zip or zip, but not as a solid archive.

share|improve this answer
This squashfs solution seems really straight-forward, I will consider it. – Philip Jan 14 '11 at 18:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.