other versions
- wheezy 0.25~git2011.11.04-5.1
- wheezy-backports 0.25-1~bpo70+1
- jessie 0.25-1
- testing 0.29-3
- unstable 0.29-3
bup-restore(1) | General Commands Manual | bup-restore(1) |
NAME¶
bup-restore - extract files from a backup setSYNOPSIS¶
bup restore [--outdir= outdir] [--exclude-rx pattern] [-v] [-q] <paths...>DESCRIPTION¶
bup restore extracts files from a backup set (created with bup-save(1)) to the local filesystem. The specified paths are of the form / branch/revision/some/where. The components of the path are as follows:- branch
- the name of the backup set to restore from; this corresponds to the --name (-n) option to bup save.
- revision
- the revision of the backup set to restore. The revision latest is always the most recent backup on the given branch. You can discover other revisions using bup ls /branch.
- some/where
- the previously saved path (after any stripping/grafting) that you want to restore. For example, etc/passwd.
OPTIONS¶
- -C, --outdir=outdir
- create and change to directory outdir before extracting the files.
- --numeric-ids
- restore numeric IDs (user, group, etc.)
rather than names.
- --exclude-rx=pattern
- exclude any path matching pattern, which must be a Python regular expression (http://docs.python.org/library/re.html). The pattern will be compared against the full path rooted at the top of the restore tree, without anchoring, so "x/y" will match "ox/yard" or "box/yards". To exclude the contents of /tmp, but not the directory itself, use "^/tmp/.". (can be specified more than once)
Note that the root of the restore tree (which matches '^/') is the top of the
archive tree being restored, and has nothing to do with the filesystem
destination. Given "restore ... /foo/latest/etc/", the pattern
'^/passwd$' would match if a file named passwd had been saved as
'/foo/latest/etc/passwd'.
Examples:
- •
- '/foo$' - exclude any file named foo
- •
- '/foo/$' - exclude any directory named foo
- •
- '/foo/.' - exclude the content of any directory named foo
- •
- '^/tmp/.' - exclude root-level /tmp's content, but not /tmp itself
- --map-user old=new
- for every path, restore the old (saved) user name as new. Specifying "" for new will clear the user. For example "--map-user foo=" will allow the uid to take effect for any path that originally had a user of "foo", unless countermanded by a subsequent "--map-user foo=..." specification. See DESCRIPTION above for further information.
- --map-group old=new
- for every path, restore the old (saved) group name as new. Specifying "" for new will clear the group. For example "--map-group foo=" will allow the gid to take effect for any path that originally had a group of "foo", unless countermanded by a subsequent "--map-group foo=..." specification. See DESCRIPTION above for further information.
- --map-uid old=new
- for every path, restore the old (saved) uid as new, unless countermanded by a subsequent "--map-uid old=..." option. Note that the uid will only be relevant for paths with no user. See DESCRIPTION above for further information.
- --map-gid old=new
- for every path, restore the old (saved) gid as new, unless countermanded by a subsequent "--map-gid old=..." option. Note that the gid will only be relevant for paths with no user. See DESCRIPTION above for further information.
- -v, --verbose
- increase log output. Given once, prints every directory as it is restored; given twice, prints every file and directory.
- -q, --quiet
- don't show the progress meter. Normally, is stderr is a tty, a progress display is printed that shows the total number of files restored.
EXAMPLE¶
Create a simple test backup set:-
$ bup index -u /etc $ bup save -n mybackup /etc/passwd /etc/profile
-
$ bup restore /mybackup/latest/etc/passwd Restoring: 1, done. $ ls -l passwd -rw-r--r-- 1 apenwarr apenwarr 1478 2010-09-08 03:06 passwd
-
$ bup restore -C test /mybackup/latest/etc Restoring: 3, done. $ find test test test/etc test/etc/passwd test/etc/profile
-
$ bup restore -C test /mybackup/latest/etc/ Restoring: 2, done. $ find test test test/passwd test/profile
-
$ bup restore -C test /mybackup/latest/etc/. Restoring: 2, done. # At this point test and etc's metadata will match. $ find test test test/passwd test/profile
-
# mkdir --mode 0700 restore-tmp # bup restore -C restore-tmp /somebackup/latest/foo Restoring: 42, done. # mv restore-tmp/foo somewhere # rmdir restore-tmp
-
# ls -l /original/y -rw-r----- 1 foo baz 3610 Nov 4 11:31 y # bup restore -C dest --map-user foo=bar --map-group baz=bax /x/latest/y Restoring: 42, done. # ls -l dest/y -rw-r----- 1 bar bax 3610 Nov 4 11:31 y
-
# ls -l /original/y -rw-r----- 1 foo baz 3610 Nov 4 11:31 y # ls -ln /original/y -rw-r----- 1 1000 1007 3610 Nov 4 11:31 y # bup restore -C dest --map-user foo= --map-uid 1000=1042 /x/latest/y Restoring: 97, done. # ls -ln dest/y -rw-r----- 1 1042 1007 3610 Nov 4 11:31 y
-
# bup restore -C dest --numeric-ids --map-uid 1000=1042 /x/latest/y Restoring: 97, done.
SEE ALSO¶
bup-save(1), bup-ftp(1), bup-fuse(1), bup-web(1)BUP¶
Part of the bup(1) suite.AUTHORS¶
Avery Pennarun <apenwarr@gmail.com>.2013-12-26 | Bup debian/0.25-1~bpo70+1 |