Scripted Restoration (GNU tar 1.34)

Previous: Scripted Backups, Up: Backups [Contents][Index]

### 5.6 Using the Restore Script

To restore files that were archived using a scripted backup, use the `restore` script. Its usage is quite straightforward. In the simplest form, invoke `restore --all`, it will then restore all the file systems and files specified in `backup-specs` (see BACKUP_DIRS).

You may select the file systems (and/or files) to restore by giving `restore` a list of patterns in its command line. For example, running

    restore 'albert:*'

will restore all file systems on the machine ‘`albert`’. A more complicated example:

    restore 'albert:*' '*:/var'

This command will restore all file systems on the machine ‘`albert`’ as well as `/var` file system on all machines.

By default `restore` will start restoring files from the lowest available dump level (usually zero) and will continue through all available dump levels. There may be situations where such a thorough restore is not necessary. For example, you may wish to restore only files from the recent level one backup. To do so, use `--level` option, as shown in the example below:

    restore --level=1

The full list of options accepted by `restore` follows:

`-a`
`--all`

  Restore all file systems and files specified in `backup-specs`.

`-l level`
`--level=level`

  Start restoring from the given backup level, instead of the default 0.

`-v[level]`
`--verbose[=level]`

  Set verbosity level. The higher the level is, the more debugging information will be output during execution. Default level is 100, which means the highest debugging level.

`-h`
`--help`

  Display short help message and exit.

`-V`
`--version`

  Display information about the program’s name, version, origin and legal status, all on standard output, and then exit successfully.

You should start the restore script with the media containing the first volume of the archive mounted. The script will prompt for other volumes as they are needed. If the archive is on tape, you don’t need to rewind the tape to to its beginning—if the tape head is positioned past the beginning of the archive, the script will rewind the tape as needed. See Tape Positioning, for a discussion of tape positioning.

> Warning: The script will delete files from the active file system if they were not in the file system when the archive was made.

See Incremental Dumps, for an explanation of how the script makes that determination.

Previous: Scripted Backups, Up: Backups [Contents][Index]