]> arthur.barton.de Git - bup.git/blob - Documentation/bup-save.md
Merge remote branch 'origin/master' into meta
[bup.git] / Documentation / bup-save.md
1 % bup-save(1) Bup %BUP_VERSION%
2 % Avery Pennarun <apenwarr@gmail.com>
3 % %BUP_DATE%
4
5 # NAME
6
7 bup-save - create a new bup backup set
8
9 # SYNOPSIS
10
11 bup save [-r *host*:*path*] <-t|-c|-n *name*> [-f *indexfile*]
12 [-v] [-q] [--smaller=*maxsize*] <paths...>
13
14 # DESCRIPTION
15
16 `bup save` saves the contents of the given files or paths
17 into a new backup set and optionally names that backup set.
18
19 Before trying to save files using `bup save`, you should
20 first update the index using `bup index`.  The reasons
21 for separating the two steps are described in the man page
22 for `bup-index`(1).
23
24 # OPTIONS
25
26 -r, --remote=*host*:*path*
27 :   save the backup set to the given remote server.  If
28     *path* is omitted, uses the default path on the remote
29     server (you still need to include the ':')
30
31 -t, --tree
32 :   after creating the backup set, print out the git tree
33     id of the resulting backup.
34     
35 -c, --commit
36 :   after creating the backup set, print out the git commit
37     id of the resulting backup.
38
39 -n, --name=*name*
40 :   after creating the backup set, create a git branch
41     named *name* so that the backup can be accessed using
42     that name.  If *name* already exists, the new backup
43     will be considered a descendant of the old *name*. 
44     (Thus, you can continually create new backup sets with
45     the same name, and later view the history of that
46     backup set to see how files have changed over time.)
47     
48 -f, --indexfile=*indexfile*
49 :   use a different index filename instead of
50     `~/.bup/bupindex`.
51
52 -v, --verbose
53 :   increase verbosity (can be used more than once).  With
54     one -v, prints every directory name as it gets backed up.  With
55     two -v, also prints every filename.
56
57 -q, --quiet
58 :   disable progress messages.
59
60 --smaller=*maxsize*
61 :   don't back up files >= *maxsize* bytes.  You can use
62     this to run frequent incremental backups of your small
63     files, which can usually be backed up quickly, and skip
64     over large ones (like virtual machine images) which
65     take longer.  Then you can back up the large files
66     less frequently.  Use a suffix like k, M, or G to
67     specify multiples of 1024, 1024*1024, 1024*1024*1024
68     respectively.
69     
70 --bwlimit=*bytes/sec*
71 :   don't transmit more than *bytes/sec* bytes per second
72     to the server.  This is good for making your backups
73     not suck up all your network bandwidth.  Use a suffix
74     like k, M, or G to specify multiples of 1024,
75     1024*1024, 1024*1024*1024 respectively.
76     
77 --strip
78 :   strips the path that is given from all files and directories.
79     
80     A directory */root/chroot/etc* saved with
81     "bup save -n chroot --strip /root/chroot" would be saved
82     as */etc*.
83     
84 --strip-prefix=*path-prefix*
85 :   strips the given path-prefix *path-prefix* from all
86     files and directories.
87     
88     A directory */root/chroots/webserver* saved with
89     "bup save -n webserver --strip-path=/root/chroots" would
90     be saved as */webserver/etc*
91     
92 --graft=*old_path*=*new_path*
93 :   a graft point *old_path*=*new_path* (can be used more than
94     once).
95
96     A directory */root/chroot/a/etc* saved with
97     "bup save -n chroots --graft /root/chroot/a/etc=/chroots/a"
98     would be saved as */chroots/a/etc*
99
100 # EXAMPLE
101
102     $ bup index -ux /etc
103     Indexing: 1981, done.
104
105     $ bup save -r myserver: -n my-pc-backup --bwlimit=50k /etc
106     Reading index: 1981, done.
107     Saving: 100.00% (998/998k, 1981/1981 files), done.
108
109
110
111     $ ls /home/joe/chroots/httpd
112     bin var
113
114     $ bup index -ux /home/joe/chroots/httpd
115     Indexing: 1337, done.
116
117     $ bup save --strip -n joes-httpd-chroot /home/joe/chroots/httpd
118     Reading index: 1337, done.
119     Saving: 100.00% (998/998k, 1337/1337 files), done.
120
121     $ bup ls joes-httpd-chroot/latest/
122     bin/
123     var/
124
125
126     $ bup save --strip-prefix=/home/joe/chroots -n joes-chroots \
127          /home/joe/chroots/httpd
128     Reading index: 1337, done.
129     Saving: 100.00% (998/998k, 1337/1337 files), done.
130
131     $ bup ls joes-chroots/latest/
132     httpd/
133
134
135     $ bup save --graft /home/joe/chroots/httpd=/http-chroot \
136          -n joe
137          /home/joe/chroots/httpd
138     Reading index: 1337, done.
139     Saving: 100.00% (998/998k, 1337/1337 files), done.
140
141     $ bup ls joe/latest/
142     http-chroot/
143
144
145 # SEE ALSO
146
147 `bup-index`(1), `bup-split`(1), `bup-on`(1),
148 `bup-restore`(1)
149
150 # BUP
151
152 Part of the `bup`(1) suite.