4 Documentation to do: (a little bit at a time)
5 - Document running a test version.
6 - Make sure restore options are documented
7 - Document query file format.
9 Testing to do: (painful)
10 - that restore options work in FD (mostly done).
11 - that console command line options work
12 - blocksize recognition code.
15 - Implement FileOptions (see end of this document)
16 - Make hash table for linked files in findlib/find_one.c:161
17 - Make bcopy read through bad tape records.
18 - Need a verbose mode in restore, perhaps to bsr.
19 - Should we dump a SOS when starting a new tape?
20 - bscan without -v is too quiet -- perhaps show jobs.
21 - Add code to reject whole blocks if not wanted on restore.
23 - Figure out how to allow multiple simultaneous file Volumes on
25 - Start working on Base jobs.
26 - Make sure the MaxVolFiles is fully implemented in SD
27 - Flush all the daemon messages at the end of every job.
28 - Check if both CatalogFiles and UseCatalog are set to SD.
29 - Check if we can increase Bacula FD priorty in Win2000
30 - Need return status on read_cb() from read_records(). Need multiple
31 records -- one per Job, maybe a JCR or some other structure with
34 - Implement Bacula plugins -- design API
36 - Work more on how to to a Bacula restore beginning with
37 just a Bacula tape and a boot floppy (bare metal recovery).
38 - Try bare metal Windows restore
39 - Fix read_record to handle multiple sessions.
40 - Program files (i.e. execute a program to read/write files).
41 Pass read date of last backup, size of file last time.
42 - Put system type returned by FD into catalog.
43 - Possibly add email to Watchdog if drive is unmounted too
44 long and a job is waiting on the drive.
45 - Strip trailing slashes from Include directory names in the FD.
46 - Use read_record.c in SD code.
47 - Why don't we get an error message from Win32 FD when bootstrap
48 file cannot be created for restore command?
49 - When Marking a file in Restore that is a hard link, also
50 mark the link so that the data will be reloaded.
51 - Restore program that errors in SD due to no tape reports
52 OK incorrectly in output.
53 - After unmount, if restore job started, ask to mount.
54 - Fix db_get_fileset in cats/sql_get.c for multiple records.
55 - Fix catalog filename truncation in sql_get and sql_create. Use
56 only a single filename split routine.
57 - Make Restore report an error if FD or SD term codes are not OK.
58 - Convert all %x substitution variables, which are hard to remember
59 and read to %(variable-name). Idea from TMDA.
60 - Add JobLevel in FD status (but make sure it is defined).
61 - Make Pool resource handle Counter resources.
62 - Remove NextId for SQLite. Optimize.
63 - Fix gethostbyname() to use gethostbyname_r()
64 - Implement ./configure --with-client-only
65 - Strip trailing / from Include
66 - Move all SQL statements into a single location.
67 - Cleanup db_update_media and db_update_pool
68 - Add UA rc and history files.
69 - put termcap (used by console) in ./configure and
70 allow -with-termcap-dir.
71 - Enhance time and size scanning routines.
72 - Fix Autoprune for Volumes to respect need for full save.
73 - Fix Win32 config file definition name on /install
74 - No READLINE_SRC if found in alternate directory.
75 - Add Client FS/OS id (Linux, Win95/98, ...).
76 - Test a second language e.g. french.
77 - Compare tape to Client files (attributes, or attributes and data)
78 - Restore options (overwrite, overwrite if older,
79 overwrite if newer, never overwrite, ...)
80 - Restore to a particular time -- e.g. before date, after date.
81 - Make all database Ids 64 bit.
82 - Write an applet for Linux.
83 - Add estimate to Console commands
84 - Find solution to blank filename (i.e. path only) problem.
85 - Implement new daemon communications protocol.
86 - Remove PoolId from Job table, it exists in Media.
87 - Allow console commands to detach or run in background.
88 - Fix status delay on storage daemon during rewind.
89 - Add SD message variables to control operator wait time
90 - Maximum Operator Wait
91 - Minimum Message Interval
92 - Maximum Message Interval
93 - Send Operator message when cannot read tape label.
94 - Verify level=Volume (scan only), level=Data (compare of data to file).
95 Verify level=Catalog, level=InitCatalog
97 - Add keyword search to show command in Console.
98 - Fix Win2000 error with no messages during startup.
99 - Events : tape has more than xxx bytes.
100 - Restrict characters permitted in a Resource name.
101 - Complete code in Bacula Resources -- this will permit
102 reading a new config file at any time.
103 - Handle ctl-c in Console
104 - Implement LabelTemplate (at least first cut).
105 - Implement script driven addition of File daemon to config files.
106 - Think about how to make Bacula work better with File archives.
108 - see setgroup and user for Bacula p4-5 of stunnel.c
109 - Implement new serialize subroutines
110 send(socket, "string", &Vol, "uint32", &i, NULL)
111 - Audit all UA commands to ensure that we always prompt where possible.
112 - If ./btape is called without /dev, assume argument is a Storage resource name.
113 - Put memory utilization in Status output of each daemon
114 if full status requested or if some level of debug on.
115 - Make database type selectable by .conf files i.e. at runtime
116 - gethostbyname failure in bnet_connect() continues
117 generating errors -- should stop.
118 - Add HOST to Volume label.
119 - Set flag for uname -a. Add to Volume label.
120 - Implement throttled work queue.
121 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
122 - Allow multiple Storage specifications (or multiple names on
123 a single Storage specification) in the Job record. Thus a job
124 can be backed up to a number of storage devices.
125 - Implement dump label to UA
126 - Concept of VolumeSet during restore which is a list
127 of Volume names needed.
128 - Restore files modified after date
129 - Restore file modified before date
130 - Emergency restore info:
132 - Backup working directory
134 - Restore -- do nothing but show what would happen
135 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
136 - Implement Restore FileSet=
137 - Create a protocol.h and protocol.c where all protocol messages
139 - If SD cannot open a drive, make it periodically retry.
140 - Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...).
141 - Timout a job or terminate if link goes down, or reopen link and query.
142 - Fill all fields in Vol/Job Header -- ensure that everything
143 needed is written to tape. Think about restore to Catalog
144 from tape. Client record needs improving.
145 - Find general solution for sscanf size problems (as well
146 as sprintf. Do at run time?
147 - Concept of precious tapes (cannot be reused).
148 - Make bcopy copy with a single tape drive.
149 - Permit changing ownership during restore.
151 - Restore should get Device and Pool information from
152 job record rather than from config.
153 - Autolabel should be specified by DR instead of SD.
154 - Find out how to get the system tape block limits, e.g.:
155 Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.
156 Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
159 - AutoScan (check checksum of tape)
160 - Format command = "format /dev/nst0"
164 - Seek resolution (usually corresponds to buffer size)
165 - EODErrorCode=ENOSPC or code
166 - Partial Read error code
167 - Partial write error code
168 - Nonformatted read error
169 - Nonformatted write error
170 - WriteProtected error
174 - IgnoreCloseErrors=yes
184 - FD sends unsaved file list to Director at end of job.
185 - Write a Storage daemon that uses pipes and
186 standard Unix programs to write to the tape.
188 - Need something that monitors the JCR queue and
189 times out jobs by asking the deamons where they are.
191 - Enhance Jmsg code to permit buffering and saving to disk.
192 - device driver = "xxxx" for drives.
193 - restart: paranoid: read label fsf to
194 eom read append block, and go
195 super-paranoid: read label, read all files
196 in between, read append block, and go
197 verify: backspace, read append block, and go
198 permissive: same as above but frees drive
199 if tape is not valid.
201 - Ensure that /dev/null works
202 - File daemon should build list of files skipped, and then
203 at end of save retry and report any errors.
204 - Need report class for messages. Perhaps
205 report resource where report=group of messages
206 - enhance scan_attrib and rename scan_jobtype, and
207 fill in code for "since" option
208 - Need to save contents of FileSet to tape?
209 - Director needs a time after which the report status is sent
210 anyway -- or better yet, a retry time for the job.
211 Don't reschedule a job if previous incarnation is still running.
212 - Figure out how to save the catalog (possibly a special FileSet).
213 - Figure out how to restore the catalog.
214 - Some way to automatically backup everything is needed????
215 - Need a structure for pending actions:
217 - termination status (part of buffered msgs?)
218 - Concept of grouping Storage devices and job can use
219 any of a number of devices
221 Read, Write, Clean, Delete
222 - Login to Bacula; Bacula users with different permissions:
223 owner, group, user, quotas
224 - Store info on each file system type (probably in the job header on tape.
225 This could be the output of df; or perhaps some sort of /etc/mtab record.
228 - Design at hierarchial storage for Bacula.
229 - Implement FSM (File System Modules).
230 - Identify unchanged or "system" files and save them to a
231 special tape thus removing them from the standard
232 backup FileSet -- BASE backup.
233 - Turn virutally all sprintfs into snprintfs.
234 - Heartbeat between daemons.
235 - Audit M_ error codes to ensure they are correct and consistent.
236 - Add variable break characters to lex analyzer.
237 Either a bit mask or a string of chars so that
238 the caller can change the break characters.
239 - Make a single T_BREAK to replace T_COMMA, etc.
240 - Ensure that File daemon and Storage daemon can
241 continue a save if the Director goes down (this
242 is NOT currently the case). Must detect socket error,
243 buffer messages for later.
244 - Enhance time/duration input to allow multiple qualifiers e.g. 3d2h
248 Bacula Projects Roadmap
250 last update 27 November 2002
252 Item 1: Multiple simultaneous Jobs. (done)
255 What: Permit multiple simultaneous jobs in Bacula.
257 Why: An enterprise level solution needs to go fast without the
258 need for the system administrator to carefully tweak
259 timing. Based on the benchmarks, during a full
260 backup, NetWorker typically hit 10 times the bandwidth to
261 the tape compared to Bacula--largely. This is probably due to
262 running parallel jobs and multi-threaded filling of buffers
263 and writing them to tape. This should also make things work
264 better when you have a mix of fast and slow machines backing
267 Notes: Bacula was designed to run multiple simultaneous jobs. Thus
268 implementing this is a matter of some small cleanups and
272 Item 2: Make the Storage daemon use intermediate file storage to buffer data.
273 Deferred -- not necessary yet.
275 What: If data is coming into the SD too fast, buffer it to
276 disk if the user has configured this option.
278 Why: This would be nice, especially if it more or less falls out
279 when implementing (1) above. If not, it probably should not
280 be given a high priority because fundamentally the backup time
281 is limited by the tape bandwidth. Even though you may finish a
282 client job quicker by spilling to disk, you still have to
283 eventually get it onto tape. If intermediate disk buffering
284 allows us to improve write bandwidth to tape, it may make
287 Notes: Whether or not this is implemented will depend upon performance
288 testing after item 1 is implemented.
291 Item 3: Write the bscan program -- also write a bcopy program.
294 What: Write a program that reads a Bacula tape and puts all the
295 appropriate data into the catalog. This allows recovery
296 from a tape that is no longer in the database, or it allows
297 re-creation of a database if lost.
299 Why: This is a fundamental robustness and disaster recovery tool
300 which will increase the comfort level of a sysadmin
301 considering adopting Bacula.
303 Notes: A skeleton of this program already exists, but much work
304 needs to be done. Implementing this will also make apparent
305 any deficiencies in the current Bacula tape format.
308 Item 4: Implement Base jobs.
310 What: A base job is sort of like a Full save except that you
311 will want the FileSet to contain only files that are unlikely
312 to change in the future (i.e. a snapshot of most of your
313 system after installing it). After the base job has been run,
314 when you are doing a Full save, you can specify to exclude
315 all files saved by the base job that have not been modified.
317 Why: This is something none of the competition does, as far as we know
318 (except BackupPC, which is a Perl program that saves to disk
319 only). It is big win for the user, it makes Bacula stand out
320 as offering a unique optimization that immediately saves time
323 Notes: Big savings in tape usage. Will require more resources because
324 the e. DIR must send FD a list of files/attribs, and the FD must
325 search the list and compare it for each file to be saved.
328 Item 5: Implement Label templates
330 What: This is a mechanism whereby Bacula can automatically create
331 a tape label for new tapes according to a detailed specification
332 provided by the user.
334 Why: It is a major convenience item for folks who use automated label
337 Notes: Bacula already has a working form of automatic tape label
338 creation, but it is very crude. The design for the complete
339 tape labeling project is already documented in the manual.
342 Item 6: Write a regression script.
345 What: This is an automatic script that runs and tests as many features
346 of Bacula as possible. The output is compared to previous
347 versions of Bacula and any differences are reported.
349 Why: This is an enormous help in preventing introduction of new
350 errors in parts of the program that already work correctly.
352 Notes: This probably should be ranked higher, it's something the typical
353 user doesn't see. Depending on how it's implemented, it may
354 make sense to defer it until the archival tape format and
355 user interface mature.
358 Item 7: GUI for interactive restore
359 Item 8: GUI for interactive backup
361 What: The current interactive restore is implemented with a tty
362 interface. It would be much nicer to be able to "see" the
363 list of files backed up in typical GUI tree format.
364 The same mechanism could also be used for creating
365 ad-hoc backup FileSets (item 8).
367 Why: Ease of use -- especially for the end user.
369 Notes: Rather than implementing in Gtk, we probably should go directly
370 for a Browser implementation, even if doing so meant the
371 capability wouldn't be available until much later. Not only
372 is there the question of Windows sites, most
373 Solaris/HP/IRIX, etc, shops can't currently run Gtk programs
374 without installing lots of stuff admins are very wary about.
375 Real sysadmins will always use the command line anyway, and
376 the user who's doing an interactive restore or backup of his
377 own files will in most cases be on a Windows machine running
381 Item 9: Add SSL to daemon communications.
383 What: This provides for secure communications between the daemons.
385 Why: This would allow doing backup across the Internet without
386 privacy concerns (or with much less concern).
388 Notes: The vast majority of near term potential users will be backing up
389 a single site over a LAN and, correctly or not, they probably
390 won't be concerned with security, at least not enough to go to
391 the trouble to set up keys, etc. to screw things down. We suspect
392 that many users genuinely interested in multi-site backup
393 already run some form of VPN software in their internetwork
394 connections, and are willing to delegate security to that layer.
397 Item 10: Define definitive tape format.
400 What: Define that definitive tape format that will not change
401 for the next millennium.
403 Why: Stability, security.
405 Notes: See notes for item 11 below.
408 Item 11: New daemon communication protocol.
410 What: The current daemon to daemon protocol is basically an ASCII
411 printf() and sending the buffer. On the receiving end, the
412 buffer is sscanf()ed to unpack it. The new scheme would
413 be a binary format that allows quick packing and unpacking
414 of any data type with named fields.
416 Why: Using binary packing would be faster. Named fields will permit
417 error checking to ensure that what is sent is what the
418 receiver really wants.
420 Notes: These are internal improvements in the interest of the
421 long-term stability and evolution of the program. On the one
422 hand, the sooner they're done, the less code we have to rip
423 up when the time comes to install them. On the other hand, they
424 don't bring an immediately perceptible benefit to potential
425 users. Item 10 and possibly item 11 should be deferred until Bacula
426 is well established with a growing user community more or
427 less happy with the feature set. At that time, it will make a
428 good "next generation" upgrade in the interest of data
434 ====================================
439 Subject: File Backup Options
442 A few days ago, a Bacula user who is backing up to file volumes and
443 using compression asked if it was possible to suppress compressing
444 all .gz files since it was a waste of CPU time. Although Bacula
445 currently permits using different options (compression, ...) on
446 a directory by directory basis, it cannot do it on a file by
447 file basis, which is clearly what was desired.
449 Proposed Implementation:
450 To solve this problem, I propose the following:
452 - Add a new Director resource type called FileOptions.
454 - The FileOptions resource will have records for all
455 options that can currently be specified on the Include record
456 (in a FileSet). Examples below.
458 - The FileOptions resource will permit an exclude option as well
459 as a number of additional options.
461 - The heart of the FileOptions resource is the ability to
462 supply any number of ApplyTo records which specify POSIX
463 regular expressions. These ApplyTo regular expressions are
464 applied to the fully qualified filename (path and all). If
465 one matches, then the FileOptions will be used.
467 - When an ApplyTo specification matches an included file, the
468 options specified in the FileOptions resource will override
469 the default options specified on the Include record.
471 - Include records will be modified to permit referencing one or
472 more FileOptions resources. The FileOptions will be used
473 in the order listed on the Include record and the first
474 one that matches will be applied.
476 - Options (or specifications) currently supplied on the Include
477 record will be deprecated (i.e. removed in a later version a
478 year or so from now).
480 - The Exclude record will be deprecated as the same functionality
481 can be obtained by using an Exclude = yes in the FileOptions.
484 The following records can appear in the FileOptions resource. An
485 asterisk preceding the name indicates a feature not currently
489 - Compression= (GZIP, ...)
490 - Signature= (MD5, SHA1, ...)
492 - OneFs= (yes/no) - remain on one filesystem
493 - Recurse= (yes/no) - recurse into subdirectories
494 - Sparse= (yes/no) - do sparse file backup
495 - *Exclude= (yes/no) - exclude file from being saved
496 - *Reader= (filename) - external read (backup) program
499 - verify= (ipnougsamc5) - verify options
502 - replace= (always/ifnewer/ifolder/never) - replace options currently
504 - *Writer= (filename) - external write (restore) program
508 Currently options specifying compression, MD5 signatures, recursion,
509 ... of a FileSet are supplied on the Include record. These will now
510 all be collected into a FileOptions resource, which will be
511 specified on the Include in place of the options. Multiple FileOptions
512 may be specified. Since the FileOptions contain regular expressions
513 that are applied to the full filename, this will give the ability
514 to specify backup options on a file by file basis to whatever level
523 Include = compression=GZIP signature=MD5 {
532 Include = FileOptions=Opts {
543 That's a lot more to do the same thing, but it gives the ability to
544 apply options on a file by file basis. For example, suppose you
545 want to compress all files but not any file with extensions .gz or .Z.
546 You could do so as follows:
550 Include = FileOptions=NoCompress FileOptions=Opts {
558 ApplyTo = /*.?*/ # matches all files
563 # Note multiple ApplyTos are ORed
564 ApplyTo = /*.gz/ # matches .gz files */
565 ApplyTo = /*.Z/ # matches .Z files */
568 Now, since the NoCompress FileOptions is specified first on the
569 Include line, any *.gz or *.Z file will have an MD5 signature computed,
570 but will not be compressed. For all other files, the NoCompress will not
571 match, so the Opts options will be used which will include GZIP
575 - Is it necessary to provide some means of ANDing regular expressions
576 and negation? (not currently planned)
578 e.g. ApplyTo = /*.gz/ && !/big.gz/
580 - I see that Networker has a "null" module which, if specified, does not
581 backup the file, but does make an record of the file in the catalog
582 so that the catalog will reflect an exact picture of the filesystem.
583 The result is that the file can be "seen" when "browsing" the save
584 sets, but it cannot be restored.
586 Is this really useful? Should it be implemented in Bacula?
589 After implementing the above, the user will be able to specify
590 on a file by file basis (using regular expressions) what options are
591 applied for the backup.
592 ====================================
594 Done: (see kernsdone for more)
595 - Add EOM records? No, not at this time. The current system works and
597 - Add VolumeUseDuration and MaximumVolumeJobs to Pool db record and
599 - Add VOLUME_CAT_INFO to the EOS tape record (as
600 well as to the EOD record). -- No, not at this time.
601 - Put MaximumVolumeSize in Director (MaximumVolumeJobs, MaximumVolumeFiles,
603 - Enhance schedule to have 1stSat, ...
604 - Make sure catalog doesn't keep growing.
605 - On I/O error, write EOF, then try to write again ? No, keep it simple.
606 - Figure out how compress everything except .gz,... files.
607 Implement FileOptions.
608 - Put Bacula version somewhere in Job stream, probably Start Session Labels.
609 - Fix start/end blocks for File devices
610 - Make Job err if WriteBootstrap fails.
611 - Test that mod of restore options works.
612 - Test that week position schedule code works.
613 - Make BSR accept count (total files to be restored).
614 - Add code to fast seek to proper place on tape/file when doing Restore.
615 - Replace popen() and pclose() -- fail safe and timeout, no SIG dep.
616 - Add code to put VolFile in bsr for restore command.
617 - Volumes can be listed multiple times in Restore volume list.
618 - Add watchdog timeout for child processes start_child_timer()
620 - Get rid of bscan.c:534 error message (one time only).
621 - Print some statistics when get EOF on device in bscan -- feedback
622 to let user know it is working.
623 - DateWritten field on tape may be wrong.
624 - Ensure that restore of differential jobs works (check SQL).
625 - Count number of ignored messages in bscan and print when first SOS is found.
626 - Test that EndFile/Block are correctly updated at end of tape
627 (in view of new block reading code).
628 - Test watchdog child timer code.
629 - Test new BSR code (mostly done).