![]() |
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z)
What are the command-line parameters to make backups with tar when we want:
1) the maximum (<=> slowest) compression ratio (keeping files and folders names inside the tar file) ? 2) the minimal (<=> fastest) compression ratio (keeping files and folders names inside the tar file) ? 3) split the tar file generated (part1, part2, and so on <=> user defines parts' size) ? Is it possible to use a "pipe" (|) to {"compress" | "split"} ? How to restore (join the splitted parts and untar) ? Is a new "pipe" possible to restore ? Thanks in advance. Best regards. |
At first glance this looks like homework, but previous posts say not....
Pipe (|) works for any command that produces output which is readable/useful by another command. take a dumb example: "cat myfile|cd" cd does not expect input, so the pipe is ignored. "Is a new "pipe" possible to restore ?" I don't know what this means... The 2 common compression schemes are gzip (.gz) and bzip2 (.bz2). gzip is faster, and bzip2 gives more compression. "man tar" for the structure of the commands and all the details. |
Quote:
Fastest to Slowest in order on smaller filesystems: 1. gzip 2. bzip2 3. rzip Fastest to Slowest in order on larger filesystems: 1. rzip 2. bzip2 3. gzip Best Compression Rate for smaller files and filesystems, bunch of files: 1. bzip2 2. gzip 3. rzip Best Compression Rate for larger files and filesystems: 1. rzip 2. bzip2 3. gzip The standard that most use would probably be gzip. There's also just zip but that's for weenies.. ;) |
trickykid - thank you!
No I know that no compression is: tar -cf archive.tar directoryname And it is possible to pipe it to split command: tar -cf directoryname | split -b 100m archive.tar What are the other commands? |
you can definitely pipe tar and split it into smaller files..
Try something like: tar cvpjf - | (cd /backup;split -b 4024m - 20061217backup.tar.bz2. ) That would split things into 4G files .. adjust as necessary.. split doesn't handle output to anything other than the current directory, which is why you need the 'cd /backup' to make sure you are backing up to the directory you want to. (substitute this with the directory you want the backup files written to) |
eldoran - thank you!
|
| All times are GMT -5. The time now is 10:01 PM. |