What do those tar options mean?
Use the tar
command for converting between mounted
file-systems and streams. For example, to back up the current root
file-system to a CD-Recorder, use the following command:
tar -clvzf - / | bbcapture --tempfile
/mnt/bigdisk/tempburn/backup.tmp --device cdr --attended
To later extract this archive back to the same disk, you would use
the command:
bbextract --device cdr | tar -zxvf -
- The "c" in -clvzf -
- Tells tar that we are creating a
new archive.
- The "l" in -clvzf -
- Tells tar to stay on the local
file system only (do not follow mounts). I specified this option to
keep each archive to a manageable size and to make it a meaningful
conceptually. I make separate archives for each of my mounted file
systems (one Linux system (/), one Linux user area (/home), and one
MSDOS area (/mnt/dosc)).
- The "v" in -clvzf -
- Verbose. Tells tar to spool out
the names of the files being archived. Primarily used for warm
fuzzies so that you can have some level of confidence that you
actually did what you thought you did. Also used as an entropy
detector... see just how many files are on your typical system.
- The "z" in -clvzf -
- Compress. Uses gnu zip to
compress the stream while writing. Achieves a 2 to 1 compression
factor on the typical system, so it is definitely worth using. Note
that already compressed data cannot be further compressed, so if you
are archiving a directory full of tarballs (.tgz files), jpegs (.jpg),
zip files (.zip) or similar compressed data, don't expect much out of
this option besides wasted CPU cycles.
- The "f -" in -clvzf -
- Specifies the output file to
use for the resulting tar file. The
-
option tells tar
not to create a file at all, but rather to send the output of tar to
standard out.
- /
- Tells tar the root of the directory tree of the
data to be archived.
- The "x" in -zxvf -
- Tells tar to extract the file
from the specified archive.
- The "f -" in -zxvf -
- Tells tar to take the input
from standard in.
Return to Backburner documentation