]> arthur.barton.de Git - bup.git/blob - Documentation/bup-save.md
Add support for "bup index --exclude-rx <pattern> ...".
[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 By default, metadata will be saved for every path, and the metadata
25 for any unindexed parent directories of indexed paths will be taken
26 directly from the filesystem.  However, if `--strip`, `--strip-path`,
27 or `--graft` is specified, metadata will not be saved for the root
28 directory (*/*).  See `bup-restore`(1) for more information about the
29 handling of metadata.
30
31 # OPTIONS
32
33 -r, \--remote=*host*:*path*
34 :   save the backup set to the given remote server.  If
35     *path* is omitted, uses the default path on the remote
36     server (you still need to include the ':').  The connection to the
37     remote server is made with SSH.  If you'd like to specify which port, user
38     or private key to use for the SSH connection, we recommend you use the
39     `~/.ssh/config` file.
40
41 -t, \--tree
42 :   after creating the backup set, print out the git tree
43     id of the resulting backup.
44     
45 -c, \--commit
46 :   after creating the backup set, print out the git commit
47     id of the resulting backup.
48
49 -n, \--name=*name*
50 :   after creating the backup set, create a git branch
51     named *name* so that the backup can be accessed using
52     that name.  If *name* already exists, the new backup
53     will be considered a descendant of the old *name*. 
54     (Thus, you can continually create new backup sets with
55     the same name, and later view the history of that
56     backup set to see how files have changed over time.)
57
58 -d, \--date=*date*
59 :   specify the date of the backup, in seconds since the epoch, instead
60     of the current time.
61
62 -f, \--indexfile=*indexfile*
63 :   use a different index filename instead of
64     `~/.bup/bupindex`.
65
66 -v, \--verbose
67 :   increase verbosity (can be used more than once).  With
68     one -v, prints every directory name as it gets backed up.  With
69     two -v, also prints every filename.
70
71 -q, \--quiet
72 :   disable progress messages.
73
74 \--smaller=*maxsize*
75 :   don't back up files >= *maxsize* bytes.  You can use
76     this to run frequent incremental backups of your small
77     files, which can usually be backed up quickly, and skip
78     over large ones (like virtual machine images) which
79     take longer.  Then you can back up the large files
80     less frequently.  Use a suffix like k, M, or G to
81     specify multiples of 1024, 1024*1024, 1024*1024*1024
82     respectively.
83     
84 \--bwlimit=*bytes/sec*
85 :   don't transmit more than *bytes/sec* bytes per second
86     to the server.  This is good for making your backups
87     not suck up all your network bandwidth.  Use a suffix
88     like k, M, or G to specify multiples of 1024,
89     1024*1024, 1024*1024*1024 respectively.
90     
91 \--strip
92 :   strips the path that is given from all files and directories.
93     
94     A directory */root/chroot/etc* saved with "bup save -n chroot
95     \--strip /root/chroot" would be saved as */etc*.  Note that
96     currently, metadata will not be saved for the root directory (*/*)
97     when this option is specified.
98     
99 \--strip-path=*path-prefix*
100 :   strips the given path prefix *path-prefix* from all
101     files and directories.
102     
103     A directory */root/chroot/webserver* saved with "bup save -n
104     webserver \--strip-path=/root/chroot" would be saved as
105     */webserver/etc*.  Note that currently, metadata will not be saved
106     for the root directory (*/*) when this option is specified.
107     
108 \--graft=*old_path*=*new_path*
109 :   a graft point *old_path*=*new_path* (can be used more than
110     once).
111
112     A directory */root/chroot/a/etc* saved with "bup save -n chroot
113     \--graft /root/chroot/a=/chroot/a" would be saved as
114     */chroot/a/etc*.  Note that currently, metadata will not be saved
115     for the root directory (*/*) when this option is specified.
116
117 -*#*, \--compress=*#*
118 :   set the compression level to # (a value from 0-9, where
119     9 is the highest and 0 is no compression).  The default
120     is 1 (fast, loose compression)
121
122
123 # EXAMPLE
124
125     $ bup index -ux /etc
126     Indexing: 1981, done.
127
128     $ bup save -r myserver: -n my-pc-backup --bwlimit=50k /etc
129     Reading index: 1981, done.
130     Saving: 100.00% (998/998k, 1981/1981 files), done.
131
132
133
134     $ ls /home/joe/chroot/httpd
135     bin var
136
137     $ bup index -ux /home/joe/chroot/httpd
138     Indexing: 1337, done.
139
140     $ bup save --strip -n joes-httpd-chroot /home/joe/chroot/httpd
141     Reading index: 1337, done.
142     Saving: 100.00% (998/998k, 1337/1337 files), done.
143
144     $ bup ls joes-httpd-chroot/latest/
145     bin/
146     var/
147
148
149     $ bup save --strip-path=/home/joe/chroot -n joes-chroot \
150          /home/joe/chroot/httpd
151     Reading index: 1337, done.
152     Saving: 100.00% (998/998k, 1337/1337 files), done.
153
154     $ bup ls joes-chroot/latest/
155     httpd/
156
157
158     $ bup save --graft /home/joe/chroot/httpd=/http-chroot \
159          -n joe
160          /home/joe/chroot/httpd
161     Reading index: 1337, done.
162     Saving: 100.00% (998/998k, 1337/1337 files), done.
163
164     $ bup ls joe/latest/
165     http-chroot/
166
167
168 # SEE ALSO
169
170 `bup-index`(1), `bup-split`(1), `bup-on`(1),
171 `bup-restore`(1), `ssh_config`(5)
172
173 # BUP
174
175 Part of the `bup`(1) suite.