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

link|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
feedback

2 Answers

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*'
link|improve this answer
feedback

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.

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

Your Answer

 
or
required, but never shown

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