tar

Splitting archive files

You may wish to split large archives so they better fit on the media you have. You can do this with tar natively, but you must interact with it during the process. A better way is to pipe the tar output to the split command.

# create archives
$ tar -cz someDirOfFilesToBeArchived | split -b 1024MiB - myfiles_split.tgz_

# uncompress
$ cat myfiles_split.tgz_* | tar -xzf - 


Following symlinks

Tar will by default, archive just the symlinks and not the content of them. To change this, use the 'h' option.

tar -cvhf /media/SDCard/Archive.tar someDirectoryWithSymlinks






The old way of splitting archives

tar -cM --tape-length=4096000 --file=/media/disk/Backup/SomeLargefile.tar.1 SomeLargefile

When tar asks you for the next volume, just enter (and increment the number as you go)

n /media/disk/Backup/SomeLargefile.tar.2


Putting them back together is a similar process

tar -x -M --file=SomeLargefile.tar.1
n SomeLargefile.tar.2
Comments