]> arthur.barton.de Git - bup.git/blob - Documentation/bup-restore.md
Documentation/bup-save.md: change --strip-prefix to --strip-path.
[bup.git] / Documentation / bup-restore.md
1 % bup-restore(1) Bup %BUP_VERSION%
2 % Avery Pennarun <apenwarr@gmail.com>
3 % %BUP_DATE%
4
5 # NAME
6
7 bup-restore - extract files from a backup set
8
9 # SYNOPSIS
10
11 bup restore [--outdir=*outdir*] [-v] [-q] <paths...>
12
13 # DESCRIPTION
14
15 `bup restore` extracts files from a backup set (created
16 with `bup-save`(1)) to the local filesystem.
17
18 The specified *paths* are of the form
19 /_branch_/_revision_/_path/to/file_.  The components of the
20 path are as follows:
21
22 branch
23 :   the name of the backup set to restore from; this
24     corresponds to the --name (-n) option to `bup save`.
25
26 revision
27 :   the revision of the backup set to restore.  The
28     revision *latest* is always the most recent
29     backup on the given branch.  You can discover other
30     revisions using `bup ls /branch`.
31     
32 /path/to/file
33 :   the original absolute filesystem path to the file you
34     want to restore.  For example, `/etc/passwd`.
35     
36 Note: if the /path/to/file is a directory, `bup restore`
37 will restore that directory as well as recursively
38 restoring all its contents.
39
40 If /path/to/file is a directory ending in a slash (ie.
41 /path/to/dir/), `bup restore` will restore the children of
42 that directory directly to the current directory (or the
43 `--outdir`).  If the directory does *not* end in a slash,
44 the children will be restored to a subdirectory of the
45 current directory.  See the EXAMPLES section to see how
46 this works.
47
48
49 # OPTIONS
50
51 -C, --outdir=*outdir*
52 :   create and change to directory *outdir* before
53     extracting the files.
54
55 -v, --verbose
56 :   increase log output.  Given once, prints every
57     directory as it is restored; given twice, prints every
58     file and directory.
59
60 -q, --quiet
61 :   don't show the progress meter.  Normally, is stderr is
62     a tty, a progress display is printed that shows the
63     total number of files restored.
64
65 # EXAMPLE
66     
67 Create a simple test backup set:
68     
69     $ bup index -u /etc
70     $ bup save -n mybackup /etc/passwd /etc/profile
71     
72 Restore just one file:
73     
74     $ bup restore /mybackup/latest/etc/passwd
75     Restoring: 1, done.
76     
77     $ ls -l passwd
78     -rw-r--r-- 1 apenwarr apenwarr 1478 2010-09-08 03:06 passwd
79     
80 Restore the whole directory (no trailing slash):
81     
82     $ bup restore -C test1 /mybackup/latest/etc
83     Restoring: 3, done.
84     
85     $ find test1
86     test1
87     test1/etc
88     test1/etc/passwd
89     test1/etc/profile
90     
91 Restore the whole directory (trailing slash):
92     
93     $ bup restore -C test2 /mybackup/latest/etc/
94     Restoring: 2, done.
95     
96     $ find test2
97     test2
98     test2/passwd
99     test2/profile
100     
101
102 # SEE ALSO
103
104 `bup-save`(1), `bup-ftp`(1), `bup-fuse`(1), `bup-web`(1)
105
106 # BUP
107
108 Part of the `bup`(1) suite.