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