restore
Restore files.
Synopsis
restore [where=<where>] [client=<client>] [storage=<storage>]
[bootstrap=<bootstrap>] [restorejob=<restorejob>] [comment=<comment>]
[jobid=<jobid>[,...]] [fileset=<fileset>]
[replace=<always|ifnewer|ifolder|never>]
[pluginoptions=<pluginoptions>] [regexwhere=<regexwhere>]
[fileregex=<fileregex>] [restoreclient=<restoreclient>]
[backupformat=<backupformat>] [pool=<pool>] [file=<file> ...]
[directory=<directory> ...] [before[=<before>]]
[strip_prefix=<strip_prefix>] [stripprefix=<stripprefix>]
[add_prefix=<add_prefix>] [addprefix=<addprefix>]
[add_suffix=<add_suffix>] [addsuffix=<addsuffix>] [select[=<select>]]
[current] [copies] [archive] [done] [all] [job=<job>] [yes]
[catalog=<catalog>]
Words without brackets are required, [ ] marks optional parts, a | b alternatives, ... a repeatable argument and [,...] a comma separated list.
Description
Selects files from backups and starts a restore job. Without a selection the Director shows the selection menu; `done` ends the file selection.
Arguments
| Argument | Type | Values / source | Default | Flags | Description |
|---|---|---|---|---|---|
where= | string | Restore prefix. | |||
client= | resource | from .clients | Client name. | ||
storage= | resource | from .storages | Storage name. | ||
bootstrap= | string | Bootstrap file. | |||
restorejob= | resource | from .jobs | Restore job. | ||
comment= | string | Comment. | |||
jobid= | string | list | Job IDs. | ||
fileset= | resource | from .filesets | FileSet name. | ||
replace= | enum | always, ifnewer, ifolder, never | Replace mode. | ||
pluginoptions= | string | Plugin options. | |||
regexwhere= | string | Restore path rewrite. | |||
fileregex= | string | Select files by regex. | |||
restoreclient= | resource | from .clients | Restore client. | ||
backupformat= | string | Backup format. | |||
pool= | resource | from .pools | Pool name. | ||
file= | string | repeatable | File to restore. | ||
directory= | string | repeatable | Directory to restore. | ||
before= | string | value optional | Most recent backup before this time. | ||
strip_prefix= | string | Strip prefix. | |||
stripprefix= | string | Strip prefix. | |||
add_prefix= | string | Add prefix. | |||
addprefix= | string | Add prefix. | |||
add_suffix= | string | Add suffix. | |||
addsuffix= | string | Add suffix. | |||
select= | string | value optional | Select. | ||
current | keyword | Most recent backup. | |||
copies | keyword | Use copies. | |||
archive | keyword | Use archive jobs. | |||
done | keyword | End the selection. | |||
all | keyword | Select every file. | |||
job= | resource | from .jobs | Job name. | ||
yes | keyword | Do not ask. | |||
catalog= | resource | from .catalogs | Catalog name. |
Examples
Restore everything of a client:
restore client=fd select current all done yes where=/tmp/r
Open the selection menu:
restore
Restore all files of job 42 to a separate directory:
restore jobid=42 client=bareos-fd restorejob=RestoreFiles where=/tmp/bareos-restores all done yes
Restore a single file from the latest backup:
restore client=bareos-fd restorejob=RestoreFiles file=/etc/fstab where=/tmp/bareos-restores yes