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