1BIO(1) General Commands Manual BIO(1)
2
3
4
6 bio - Barry Input / Output
7
9 bio -i <input type> [input args] -o <output type> [output args] [-o
10 <output type> ...]
11
13 bio is a command line tool that treats devices, backups, and data
14 streams as input and output. bio supports the following types of IO
15 (actual type name shown in bold):
16
17
18 device
19
20 tar (backup files)
21
22 boost (serialization files and streams)
23
24 mime streams
25
26 ldif streams
27
28 human readable and hex text dump
29
30 sha1 sum output
31
32 cstore for extracting Content Store records
33
34
35 Each command line consists of at least one input and output option,
36 along with their switches. More than one output can be used, as long
37 as they do not conflict with each other. For example, it is not possi‐
38 ble to read and write from the same device PIN.
39
40
41 This tool combines a lot of the functionality of btool, btardump, brec‐
42 sum, and bs11nread, but does it more flexibly, and improves functional‐
43 ity in some cases, such as Boost archives being able to contain more
44 than one database.
45
46
48 The device type is used to read or write from a device connected via
49 USB. Some of the options below are valid only in one input or output
50 mode, some in both.
51
52 -d db Name of database to load, when using the device type as input.
53 Can be used multiple times. See btool -t for a list of data‐
54 bases on the device.
55
56 -A Selects all databases found on the device, instead of adding
57 them manually via the -d option.
58
59 -p pin PIN of device to talk to. Valid for both input and output.
60 Only needed if you have more than one Blackberry connected at
61 once.
62
63 -P password
64 Simplistic method to specify device password. In a real appli‐
65 cation, this would be done using a more secure prompt.
66
67 -w mode
68 Set write mode when using the device type in output mode. This
69 must be specified, or nothing will be written. Can be one of:
70 erase, overwrite, addonly, addnew.
71
72
73 erase Erases all records from existing database and adds all new
74 records to the device, using their Unique IDs, if available.
75 This is what you would normally use to restore a backup.
76
77 overwrite Adds any new records, and for records with Unique IDs
78 that already exist on the device, overwrite them.
79
80 addonly Adds any new records, but if a record exists in the
81 device with the same Unique ID, skip that record and don't write
82 it to the device.
83
84 addnew Adds all incoming records as brand new records, generat‐
85 ing a new Unique ID for each one, and leaving any existing
86 records intact. This may cause data duplication if you're
87 restoring data that initially came from this same device. Use
88 this for copying data from another device, while keeping your
89 existing records.
90
91
93 The tar type is used to read or write from a backup file created by
94 btool or the backup GUI.
95
96 -d db Name of database to load, when using the tar type as input. Can
97 be used multiple times. Note that if no -d options are speci‐
98 fied, bio defaults to reading all available databases.
99
100 -f file
101 The tar backup file to read or write from. Bio uses gzip com‐
102 pressed tar files, so suitable extensions would be .tgz and
103 .tar.gz. Unfortunately, due to internal limitations, an actual
104 file must be specified here, and not - for stdin / stdout.
105
106
108 The boost type is used to read and write parsable records in Boost
109 Serialization format. These files were historically written and read
110 by btool and bs11nread. Bio is more flexible, in that it can contain
111 multiple databases in one serialization archive.
112
113 -f file
114 Filename to read from or write to. Use - to specify stdin or
115 stdout. If not specified for input, defaults to stdin, but
116 since output can contain non‐ASCII chars, you must use -f - if
117 you want to write to stdout.
118
119
121 The ldif type is used to read or write ldif output, like the output of
122 the LDAP command line tool ldapsearch.
123
124 -c dn When using ldif as output, specify the base DN.
125
126 -C dnattr
127 Again, for output, specify the attribute name to use when build‐
128 ing the FQDN.
129
130
132 The mime type is used to read or write VCARD, VEVENT, VTODO, or VJOUR‐
133 NAL records based on the Address Book, Calendar, Tasks, or Memos data‐
134 bases respectively.
135
136 -f file
137 Filename to read from or write to. Defaults to - for stdin or
138 stdout.
139
140
142 The dump type is used only for output, and sends human readable record
143 data to stdout. Parsable records are parsed; unknown records are
144 dumped in hex format.
145
146 -n Use hex format for all records.
147
148 -T Show only the names of the databases.
149
150
152 The sha1 type is used to mimic the behaviour of the brecsum command.
153 It calculates a SHA1 sum on the raw record data and sends the sum to
154 stdout.
155
156 -t Include the DB Name, Type, and Unique record ID in the checksum
157 for each record.
158
159
161 The cstore type is used to parse Content Store records.
162
163 -l List the filenames and folders found in the Content Store data‐
164 base.
165
166 -f file
167 Select a filename from the above list to extract and save
168 locally. Specify the entire path as shown in the -l list. If
169 the file is found in the device, it will be written to the cur‐
170 rent directory, using the base filename as the name. If a file
171 by that name exists already, the filename will be modified to
172 avoid overwriting local files.
173
174
176 -h Displays a detailed summary of command line options.
177
178 -I cs Set the international charset for string conversions. Valid
179 values here are available with iconv --list
180
181 -S Show list of supported database parsers and builders.
182
183 -v Dump verbose low level protocol data during USB operations, to
184 stdout.
185
186
187
188
189
191 1) Backup a full device to tar backup:
192
193 bio -i device -A -o tar -f mybackup.tar.gz
194
195 2) Read a backup file and convert the Address Book to MIME
196
197 bio -i tar -f mybackup.tar.gz -d "Address Book" -o mime
198
199 3) Restore a single database to a device
200
201 bio -i tar -f mybackup.tar.gz -d "Address Book" -o device -w
202 erase
203
204 4) Copy the Calendar from one device to another, and dump
205 the records to stdout in human readable format at the same time
206
207 bio -i device -p 3009efe3 -d Calendar -o device -p 204062f3 -w
208 erase -o dump
209
210 5) Read LDIF input and convert the contacts to MIME format
211
212 ldapsearch -x | bio -i ldif -o mime
213
214 6) Test the record code by running the Tasks database through
215 the Boost storage and back to human readable
216
217 bio -i device -d Tasks -o dump
218
219 vs.
220
221 bio -i device -d Tasks -o boost -f - | bio -i boost -f - -o dump
222
223
225 bio is part of the Barry project.
226
228 http://www.netdirect.ca/barry
229
230
231
232
233 August 17, 2012 BIO(1)