From LQWiki
Jump to: navigation, search

dar is short for "disk archive". dar is both a command and a file format used by the command. It is used to collect several files into one archive, possibly split into several files (also known as "slices").

The official dar documentation refers to tar as its "grand-brother" and has a number of similarities, but dar implements features that were not possible when recording magnetic tapes, which was the original purpose of tar. For instance, it uses a format that exploits the random-access capabilities of disk files for quicker access to individual files in the archive.


dar [ -c | -t | -l | -x | -d | -* | -C ] [<path>/]<basename> [<options>] [<user targets>]
dar -h
dar -V

Unlike some other programs, "user targets" are not filenames but instead are names to be matched with configuration-file sections; these are a rich family of filters and other qualifiers that affect the way dar works. If the operation should not affect all files in the root (or the backup) this is done through options.

About dar

Dar has several uses, but the most commonly used is to extract or to create dar archives.

It is specifically optimized for disk (or other seekable) archives, with a few distinctive features

  • since the archives are seekable, selective extraction can be very fast.
  • it is designed for archives that span volumes, in that archives are expected to comprise multiple "slices" and dar supports pauses to mount new volumes containing those slices.
  • compression is applied to individual files, and may be suppressed for some file types.
  • a "root" is used as a reference, and only files under that root are archived.


To back up your home directory to a file (./myhome.1.dar) use either of

   dar --create myhome --root ~ --exclude "myhome.*' 
   dar -c myhome -R ~ -X "myhome.*"

NOTES: the archive always decorates the name given with a slice number and ".dar". The exclusion is to prevent recursive archiving of the archive.

To back up specific files in your home directory (filename will be myfiles.1.dar) use either of

   dar --create myfiles --root ~ --go-into file1  --go-into file2
   dar -c myfiles -R ~ -g file1 -g file2

NOTES: in the absence of "--go-into" the entire root would be backed up.

See Also

External Links

This article is a stub and needs to be finished. Plunge forward and help it grow!