]> arthur.barton.de Git - bup.git/blob - Documentation/bup-split.md
Add restore option "--exclude-rx-from FILE".
[bup.git] / Documentation / bup-split.md
1 % bup-split(1) Bup %BUP_VERSION%
2 % Avery Pennarun <apenwarr@gmail.com>
3 % %BUP_DATE%
4
5 # NAME
6
7 bup-split - save individual files to bup backup sets
8
9 # SYNOPSIS
10
11 bup split \[-t\] \[-c\] \[-n *name*\] COMMON\_OPTIONS
12
13 bup split -b COMMON\_OPTIONS
14
15 bup split \<--noop \[--copy\]|--copy\> COMMON\_OPTIONS
16
17 COMMON\_OPTIONS
18   ~ \[-r *host*:*path*\] \[-v\] \[-q\] \[-d *seconds-since-epoch*\] \[\--bench\]
19     \[\--max-pack-size=*bytes*\] \[-#\] \[\--bwlimit=*bytes*\]
20     \[\--max-pack-objects=*n*\] \[\--fanout=*count*\]
21     \[\--keep-boundaries\] \[--git-ids | filenames...\]
22
23 # DESCRIPTION
24
25 `bup split` concatenates the contents of the given files
26 (or if no filenames are given, reads from stdin), splits
27 the content into chunks of around 8k using a rolling
28 checksum algorithm, and saves the chunks into a bup
29 repository.  Chunks which have previously been stored are
30 not stored again (ie. they are 'deduplicated').
31
32 Because of the way the rolling checksum works, chunks
33 tend to be very stable across changes to a given file,
34 including adding, deleting, and changing bytes.
35
36 For example, if you use `bup split` to back up an XML dump
37 of a database, and the XML file changes slightly from one
38 run to the next, nearly all the data will still be
39 deduplicated and the size of each backup after the first
40 will typically be quite small.
41
42 Another technique is to pipe the output of the `tar`(1) or
43 `cpio`(1) programs to `bup split`.  When individual files
44 in the tarball change slightly or are added or removed, bup
45 still processes the remainder of the tarball efficiently. 
46 (Note that `bup save` is usually a more efficient way to
47 accomplish this, however.)
48
49 To get the data back, use `bup-join`(1).
50
51 # MODES
52
53 These options select the primary behavior of the command, with -n
54 being the most likely choice.
55
56 -n, \--name=*name*
57 :   after creating the dataset, create a git branch
58     named *name* so that it can be accessed using
59     that name.  If *name* already exists, the new dataset
60     will be considered a descendant of the old *name*.
61     (Thus, you can continually create new datasets with
62     the same name, and later view the history of that
63     dataset to see how it has changed over time.)
64
65 -t, \--tree
66 :   output the git tree id of the resulting dataset.
67
68 -c, \--commit
69 :   output the git commit id of the resulting dataset.
70
71 -b, \--blobs
72 :   output a series of git blob ids that correspond to the chunks in
73     the dataset.  Incompatible with -n, -t, and -c.
74
75 \--noop
76 :   read the data and split it into blocks based on the "bupsplit"
77     rolling checksum algorithm, but don't do anything with the blocks.
78     This is mostly useful for benchmarking.  Incompatible with -n, -t,
79     -c, and -b.
80
81 \--copy
82 :   like `--noop`, but also write the data to stdout.  This can be
83     useful for benchmarking the speed of read+bupsplit+write for large
84     amounts of data.  Incompatible with -n, -t, -c, and -b.
85
86 # OPTIONS
87
88 -r, \--remote=*host*:*path*
89 :   save the backup set to the given remote server.  If
90     *path* is omitted, uses the default path on the remote
91     server (you still need to include the ':').  The connection to the
92     remote server is made with SSH.  If you'd like to specify which port, user
93     or private key to use for the SSH connection, we recommend you use the
94     `~/.ssh/config` file.
95
96 -d, \--date=*seconds-since-epoch*
97 :   specify the date inscribed in the commit (seconds since 1970-01-01).
98
99 -q, \--quiet
100 :   disable progress messages.
101
102 -v, \--verbose
103 :   increase verbosity (can be used more than once).
104
105 \--git-ids
106 :   stdin is a list of git object ids instead of raw data.
107     `bup split` will read the contents of each named git
108     object (if it exists in the bup repository) and split
109     it.  This might be useful for converting a git
110     repository with large binary files to use bup-style
111     hashsplitting instead.  This option is probably most
112     useful when combined with `--keep-boundaries`.
113
114 \--keep-boundaries
115 :   if multiple filenames are given on the command line,
116     they are normally concatenated together as if the
117     content all came from a single file.  That is, the
118     set of blobs/trees produced is identical to what it
119     would have been if there had been a single input file. 
120     However, if you use `--keep-boundaries`, each file is
121     split separately.  You still only get a single tree or
122     commit or series of blobs, but each blob comes from
123     only one of the files; the end of one of the input
124     files always ends a blob.
125
126 \--bench
127 :   print benchmark timings to stderr.
128
129 \--max-pack-size=*bytes*
130 :   never create git packfiles larger than the given number
131     of bytes.  Default is 1 billion bytes.  Usually there
132     is no reason to change this.
133
134 \--max-pack-objects=*numobjs*
135 :   never create git packfiles with more than the given
136     number of objects.  Default is 200 thousand objects. 
137     Usually there is no reason to change this.
138     
139 \--fanout=*numobjs*
140 :   when splitting very large files, try and keep the number
141     of elements in trees to an average of *numobjs*.
142
143 \--bwlimit=*bytes/sec*
144 :   don't transmit more than *bytes/sec* bytes per second
145     to the server.  This is good for making your backups
146     not suck up all your network bandwidth.  Use a suffix
147     like k, M, or G to specify multiples of 1024,
148     1024*1024, 1024*1024*1024 respectively.
149
150 -*#*, \--compress=*#*
151 :   set the compression level to # (a value from 0-9, where
152     9 is the highest and 0 is no compression).  The default
153     is 1 (fast, loose compression)
154
155
156 # EXAMPLE
157     
158     $ tar -cf - /etc | bup split -r myserver: -n mybackup-tar
159     tar: Removing leading /' from member names
160     Indexing objects: 100% (196/196), done.
161     
162     $ bup join -r myserver: mybackup-tar | tar -tf - | wc -l
163     1961
164     
165
166 # SEE ALSO
167
168 `bup-join`(1), `bup-index`(1), `bup-save`(1), `bup-on`(1), `ssh_config`(5)
169
170 # BUP
171
172 Part of the `bup`(1) suite.