4 Documentation to do: (a little bit at a time)
5 - Document running a test version.
6 - Document query file format.
7 - Document static linking
8 - Document fixing tape file after crash (update Media set VolFiles=xx
9 where MediaId=yy; update status to append).
12 Testing to do: (painful)
13 - that console command line options work
14 - blocksize recognition code.
17 - Look at ua_prune.c in detail. Why did JobType work at all??????
18 - Figure out how to allow multiple simultaneous file Volumes on
20 - Why are save/restore of device different sizes (sparse?)
21 - Make sure differential handled correctly
24 - Implement some why for the Console to dynamically create
26 - Cancel does not work for restore in FD.
27 - Restore to a particular time -- e.g. before date, after date.
29 - Implement disk spooling
30 - Implement finer multiprocessing options.
31 - Solaris -I on tar for include list
32 - Add whereabslinks to where or not where absolute links
33 - Figure out some way to automatically backup all local partitions
34 - Enable avoid backing up archive device (findlib/find_one.c:128)
35 - Implement FileOptions (see end of this document)
36 - Implement Bacula plugins -- design API
37 - Make hash table for linked files in findlib/find_one.c:161
38 - Make bcopy read through bad tape records.
39 - Need a verbose mode in restore, perhaps to bsr.
40 - bscan without -v is too quiet -- perhaps show jobs.
41 - Add code to reject whole blocks if not wanted on restore.
42 - Implement multiple simultaneous file Volumes on a single device.
43 - Start working on Base jobs.
44 - Make sure the MaxVolFiles is fully implemented in SD
45 - Flush all the daemon messages at the end of every job.
46 - Check if both CatalogFiles and UseCatalog are set to SD.
47 - Check if we can increase Bacula FD priorty in Win2000
48 - Need return status on read_cb() from read_records(). Need multiple
49 records -- one per Job, maybe a JCR or some other structure with
51 - Figure out how to do a bare metal Windows restore
52 - Fix read_record to handle multiple sessions.
53 - Program files (i.e. execute a program to read/write files).
54 Pass read date of last backup, size of file last time.
55 - Put system type returned by FD into catalog.
56 - Possibly add email to Watchdog if drive is unmounted too
57 long and a job is waiting on the drive.
58 - Strip trailing slashes from Include directory names in the FD.
59 - Use read_record.c in SD code.
60 - Why don't we get an error message from Win32 FD when bootstrap
61 file cannot be created for restore command?
62 - Need to specify MaximumConcurrentJobs in the Job resource.
63 - When Marking a file in Restore that is a hard link, also
64 mark the link so that the data will be reloaded.
65 - Restore program that errors in SD due to no tape reports
66 OK incorrectly in output.
67 - After unmount, if restore job started, ask to mount.
68 - Make Restore report an error if FD or SD term codes are not OK.
69 - Convert all %x substitution variables, which are hard to remember
70 and read to %(variable-name). Idea from TMDA.
71 - Add JobLevel in FD status (but make sure it is defined).
72 - Make Pool resource handle Counter resources.
73 - Remove NextId for SQLite. Optimize.
74 - Strip trailing / from Include
75 - Move all SQL statements into a single location.
76 - Cleanup db_update_media and db_update_pool
77 - Add UA rc and history files.
78 - put termcap (used by console) in ./configure and
79 allow -with-termcap-dir.
80 - Enhance time and size scanning routines.
81 - Fix Autoprune for Volumes to respect need for full save.
82 - Fix Win32 config file definition name on /install
83 - No READLINE_SRC if found in alternate directory.
84 - Add Client FS/OS id (Linux, Win95/98, ...).
85 - Test a second language e.g. french.
86 - Compare tape to Client files (attributes, or attributes and data)
87 - Make all database Ids 64 bit.
88 - Write an applet for Linux.
89 - Add estimate to Console commands
90 - Find solution to blank filename (i.e. path only) problem.
91 - Implement new daemon communications protocol.
92 - Remove PoolId from Job table, it exists in Media.
93 - Allow console commands to detach or run in background.
94 - Fix status delay on storage daemon during rewind.
95 - Add SD message variables to control operator wait time
96 - Maximum Operator Wait
97 - Minimum Message Interval
98 - Maximum Message Interval
99 - Send Operator message when cannot read tape label.
100 - Verify level=Volume (scan only), level=Data (compare of data to file).
101 Verify level=Catalog, level=InitCatalog
103 - Add keyword search to show command in Console.
104 - Fix Win2000 error with no messages during startup.
105 - Events : tape has more than xxx bytes.
106 - Restrict characters permitted in a Resource name.
107 - Complete code in Bacula Resources -- this will permit
108 reading a new config file at any time.
109 - Handle ctl-c in Console
110 - Implement LabelTemplate (at least first cut).
111 - Implement script driven addition of File daemon to config files.
112 - Think about how to make Bacula work better with File (non-tape) archives.
114 - Implement new serialize subroutines
115 send(socket, "string", &Vol, "uint32", &i, NULL)
116 - Audit all UA commands to ensure that we always prompt where possible.
117 - If ./btape is called without /dev, assume argument is a Storage resource name.
118 - Put memory utilization in Status output of each daemon
119 if full status requested or if some level of debug on.
120 - Make database type selectable by .conf files i.e. at runtime
121 - gethostbyname failure in bnet_connect() continues
122 generating errors -- should stop.
123 - Set flag for uname -a. Add to Volume label.
124 - Implement throttled work queue.
125 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
126 - Allow multiple Storage specifications (or multiple names on
127 a single Storage specification) in the Job record. Thus a job
128 can be backed up to a number of storage devices.
129 - Implement dump label to UA
130 - Concept of VolumeSet during restore which is a list
131 of Volume names needed.
132 - Restore files modified after date
133 - Restore file modified before date
134 - Emergency restore info:
136 - Backup working directory
138 - Restore -- do nothing but show what would happen
139 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
140 - Implement Restore FileSet=
141 - Create a protocol.h and protocol.c where all protocol messages
143 - If SD cannot open a drive, make it periodically retry.
144 - Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...).
145 - Timout a job or terminate if link goes down, or reopen link and query.
146 - Find general solution for sscanf size problems (as well
147 as sprintf. Do at run time?
148 - Concept of precious tapes (cannot be reused).
149 - Make bcopy copy with a single tape drive.
150 - Permit changing ownership during restore.
152 - Autolabel should be specified by DIR instead of SD.
153 - Find out how to get the system tape block limits, e.g.:
154 Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.
155 Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
158 - AutoScan (check checksum of tape)
159 - Format command = "format /dev/nst0"
163 - Seek resolution (usually corresponds to buffer size)
164 - EODErrorCode=ENOSPC or code
165 - Partial Read error code
166 - Partial write error code
167 - Nonformatted read error
168 - Nonformatted write error
169 - WriteProtected error
173 - IgnoreCloseErrors=yes
183 - FD sends unsaved file list to Director at end of job (see
185 - File daemon should build list of files skipped, and then
186 at end of save retry and report any errors.
187 - Write a Storage daemon that uses pipes and
188 standard Unix programs to write to the tape.
190 - Need something that monitors the JCR queue and
191 times out jobs by asking the deamons where they are.
192 - Enhance Jmsg code to permit buffering and saving to disk.
193 - device driver = "xxxx" for drives.
194 - restart: paranoid: read label fsf to
195 eom read append block, and go
196 super-paranoid: read label, read all files
197 in between, read append block, and go
198 verify: backspace, read append block, and go
199 permissive: same as above but frees drive
200 if tape is not valid.
202 - Ensure that /dev/null works
203 - Need report class for messages. Perhaps
204 report resource where report=group of messages
205 - enhance scan_attrib and rename scan_jobtype, and
206 fill in code for "since" option
207 - Director needs a time after which the report status is sent
208 anyway -- or better yet, a retry time for the job.
209 Don't reschedule a job if previous incarnation is still running.
210 - Some way to automatically backup everything is needed????
211 - Need a structure for pending actions:
213 - termination status (part of buffered msgs?)
214 - Concept of grouping Storage devices and job can use
215 any of a number of devices
217 Read, Write, Clean, Delete
218 - Login to Bacula; Bacula users with different permissions:
219 owner, group, user, quotas
220 - Store info on each file system type (probably in the job header on tape.
221 This could be the output of df; or perhaps some sort of /etc/mtab record.
224 - Design at hierarchial storage for Bacula.
225 - Implement FSM (File System Modules).
226 - Identify unchanged or "system" files and save them to a
227 special tape thus removing them from the standard
228 backup FileSet -- BASE backup.
229 - Turn virutally all sprintfs into snprintfs.
230 - Heartbeat between daemons.
231 - Audit M_ error codes to ensure they are correct and consistent.
232 - Add variable break characters to lex analyzer.
233 Either a bit mask or a string of chars so that
234 the caller can change the break characters.
235 - Make a single T_BREAK to replace T_COMMA, etc.
236 - Ensure that File daemon and Storage daemon can
237 continue a save if the Director goes down (this
238 is NOT currently the case). Must detect socket error,
239 buffer messages for later.
240 - Enhance time/duration input to allow multiple qualifiers e.g. 3d2h
244 Bacula Projects Roadmap
246 last update 5 January 2003
248 Item 1: Multiple simultaneous Jobs. (done)
249 Done -- Restore part needs better implementation to work correctly
251 What: Permit multiple simultaneous jobs in Bacula.
253 Why: An enterprise level solution needs to go fast without the
254 need for the system administrator to carefully tweak
255 timing. Based on the benchmarks, during a full
256 backup, NetWorker typically hit 10 times the bandwidth to
257 the tape compared to Bacula--largely. This is probably due to
258 running parallel jobs and multi-threaded filling of buffers
259 and writing them to tape. This should also make things work
260 better when you have a mix of fast and slow machines backing
263 Notes: Bacula was designed to run multiple simultaneous jobs. Thus
264 implementing this is a matter of some small cleanups and
268 Item 2: Make the Storage daemon use intermediate file storage to buffer data.
269 Deferred -- not necessary yet.
271 What: If data is coming into the SD too fast, buffer it to
272 disk if the user has configured this option.
274 Why: This would be nice, especially if it more or less falls out
275 when implementing (1) above. If not, it probably should not
276 be given a high priority because fundamentally the backup time
277 is limited by the tape bandwidth. Even though you may finish a
278 client job quicker by spilling to disk, you still have to
279 eventually get it onto tape. If intermediate disk buffering
280 allows us to improve write bandwidth to tape, it may make
283 Notes: Whether or not this is implemented will depend upon performance
284 testing after item 1 is implemented.
287 Item 3: Write the bscan program -- also write a bcopy program.
290 What: Write a program that reads a Bacula tape and puts all the
291 appropriate data into the catalog. This allows recovery
292 from a tape that is no longer in the database, or it allows
293 re-creation of a database if lost.
295 Why: This is a fundamental robustness and disaster recovery tool
296 which will increase the comfort level of a sysadmin
297 considering adopting Bacula.
299 Notes: A skeleton of this program already exists, but much work
300 needs to be done. Implementing this will also make apparent
301 any deficiencies in the current Bacula tape format.
304 Item 4: Implement Base jobs.
306 What: A base job is sort of like a Full save except that you
307 will want the FileSet to contain only files that are unlikely
308 to change in the future (i.e. a snapshot of most of your
309 system after installing it). After the base job has been run,
310 when you are doing a Full save, you can specify to exclude
311 all files saved by the base job that have not been modified.
313 Why: This is something none of the competition does, as far as we know
314 (except BackupPC, which is a Perl program that saves to disk
315 only). It is big win for the user, it makes Bacula stand out
316 as offering a unique optimization that immediately saves time
319 Notes: Big savings in tape usage. Will require more resources because
320 the e. DIR must send FD a list of files/attribs, and the FD must
321 search the list and compare it for each file to be saved.
324 Item 5: Implement Label templates
326 What: This is a mechanism whereby Bacula can automatically create
327 a tape label for new tapes according to a detailed specification
328 provided by the user.
330 Why: It is a major convenience item for folks who use automated label
333 Notes: Bacula already has a working form of automatic tape label
334 creation, but it is very crude. The design for the complete
335 tape labeling project is already documented in the manual.
338 Item 6: Write a regression script.
341 What: This is an automatic script that runs and tests as many features
342 of Bacula as possible. The output is compared to previous
343 versions of Bacula and any differences are reported.
345 Why: This is an enormous help in preventing introduction of new
346 errors in parts of the program that already work correctly.
348 Notes: This probably should be ranked higher, it's something the typical
349 user doesn't see. Depending on how it's implemented, it may
350 make sense to defer it until the archival tape format and
351 user interface mature.
354 Item 7: GUI for interactive restore
355 Item 8: GUI for interactive backup
357 What: The current interactive restore is implemented with a tty
358 interface. It would be much nicer to be able to "see" the
359 list of files backed up in typical GUI tree format.
360 The same mechanism could also be used for creating
361 ad-hoc backup FileSets (item 8).
363 Why: Ease of use -- especially for the end user.
365 Notes: Rather than implementing in Gtk, we probably should go directly
366 for a Browser implementation, even if doing so meant the
367 capability wouldn't be available until much later. Not only
368 is there the question of Windows sites, most
369 Solaris/HP/IRIX, etc, shops can't currently run Gtk programs
370 without installing lots of stuff admins are very wary about.
371 Real sysadmins will always use the command line anyway, and
372 the user who's doing an interactive restore or backup of his
373 own files will in most cases be on a Windows machine running
377 Item 9: Add SSL to daemon communications.
379 What: This provides for secure communications between the daemons.
381 Why: This would allow doing backup across the Internet without
382 privacy concerns (or with much less concern).
384 Notes: The vast majority of near term potential users will be backing up
385 a single site over a LAN and, correctly or not, they probably
386 won't be concerned with security, at least not enough to go to
387 the trouble to set up keys, etc. to screw things down. We suspect
388 that many users genuinely interested in multi-site backup
389 already run some form of VPN software in their internetwork
390 connections, and are willing to delegate security to that layer.
393 Item 10: Define definitive tape format.
396 What: Define that definitive tape format that will not change
397 for the next millennium.
399 Why: Stability, security.
401 Notes: See notes for item 11 below.
404 Item 11: New daemon communication protocol.
406 What: The current daemon to daemon protocol is basically an ASCII
407 printf() and sending the buffer. On the receiving end, the
408 buffer is sscanf()ed to unpack it. The new scheme would
409 be a binary format that allows quick packing and unpacking
410 of any data type with named fields.
412 Why: Using binary packing would be faster. Named fields will permit
413 error checking to ensure that what is sent is what the
414 receiver really wants.
416 Notes: These are internal improvements in the interest of the
417 long-term stability and evolution of the program. On the one
418 hand, the sooner they're done, the less code we have to rip
419 up when the time comes to install them. On the other hand, they
420 don't bring an immediately perceptible benefit to potential
421 users. Item 10 and possibly item 11 should be deferred until Bacula
422 is well established with a growing user community more or
423 less happy with the feature set. At that time, it will make a
424 good "next generation" upgrade in the interest of data
430 ======================================================
432 It is somewhat like a Full save becomes an incremental since
433 the Base job (or jobs) plus other non-base files.
435 - New BaseFile table that contains:
436 JobId, BaseJobId, FileId (from Base).
437 i.e. for each base file that exists but is not saved because
438 it has not changed, the File daemon sends the JobId, BaseId,
439 and FileId back to the Director who creates the DB entry.
440 - To initiate a Base save, the Director sends the FD
441 the FileId, and full filename for each file in the Base.
442 - When the FD finds a Base file, he requests the Director to
443 send him the full File entry (stat packet plus MD5), or
444 conversely, the FD sends it to the Director and the Director
445 says yes or no. This can be quite rapid if the FileId is kept
446 by the FD for each Base Filename.
447 - It is probably better to have the comparison done by the FD
448 despite the fact that the File entry must be sent across the
450 - An alternative would be to send the FD the whole File entry
451 from the start. The disadvantage is that it requires a lot of
452 space. The advantage is that it requires less communications
454 - The Job record must be updated to indicate that one or more
456 - At end of Job, FD returns:
457 1. Count of base files/bytes not written to tape (i.e. matches)
458 2. Count of base file that were saved i.e. had changed.
459 - No tape record would be written for a Base file that matches, in the
460 same way that no tape record is written for Incremental jobs where
461 the file is not saved because it is unchanged.
462 - On a restore, all the Base file records must explicitly be
463 found from the BaseFile tape. I.e. for each Full save that is marked
464 to have one or more Base Jobs, search the BaseFile for all occurrences
466 - An optimization might be to make the BaseFile have:
472 This would avoid the need to explicitly fetch each File record for
473 the Base job. The Base Job record will be fetched to get the
474 VolSessionId and VolSessionTime.
475 =========================================================
477 ==========================================================
479 For each Incremental job that is run, there may be files that
480 were found but not saved because they were locked (this applies
481 only to Windows). Such a system could send back to the Director
482 a list of Unsaved files.
484 - New UnSavedFiles table that contains:
488 - Then in the next Incremental job, the list of Unsaved Files will be
489 feed to the FD, who will ensure that they are explicitly chosen even
490 if standard date/time check would not have selected them.
491 =============================================================
495 =============================================================
497 Request For Comments For File Backup Options
500 Subject: File Backup Options
503 A few days ago, a Bacula user who is backing up to file volumes and
504 using compression asked if it was possible to suppress compressing
505 all .gz files since it was a waste of CPU time. Although Bacula
506 currently permits using different options (compression, ...) on
507 a directory by directory basis, it cannot do it on a file by
508 file basis, which is clearly what was desired.
510 Proposed Implementation:
511 To solve this problem, I propose the following:
513 - Add a new Director resource type called FileOptions.
515 - The FileOptions resource will have records for all
516 options that can currently be specified on the Include record
517 (in a FileSet). Examples below.
519 - The FileOptions resource will permit an exclude option as well
520 as a number of additional options.
522 - The heart of the FileOptions resource is the ability to
523 supply any number of ApplyTo records which specify POSIX
524 regular expressions. These ApplyTo regular expressions are
525 applied to the fully qualified filename (path and all). If
526 one matches, then the FileOptions will be used.
528 - When an ApplyTo specification matches an included file, the
529 options specified in the FileOptions resource will override
530 the default options specified on the Include record.
532 - Include records will be modified to permit referencing one or
533 more FileOptions resources. The FileOptions will be used
534 in the order listed on the Include record and the first
535 one that matches will be applied.
537 - Options (or specifications) currently supplied on the Include
538 record will be deprecated (i.e. removed in a later version a
539 year or so from now).
541 - The Exclude record will be deprecated as the same functionality
542 can be obtained by using an Exclude = yes in the FileOptions.
545 The following records can appear in the FileOptions resource. An
546 asterisk preceding the name indicates a feature not currently
550 - Compression= (GZIP, ...)
551 - Signature= (MD5, SHA1, ...)
553 - OneFs= (yes/no) - remain on one filesystem
554 - Recurse= (yes/no) - recurse into subdirectories
555 - Sparse= (yes/no) - do sparse file backup
556 - *Exclude= (yes/no) - exclude file from being saved
557 - *Reader= (filename) - external read (backup) program
558 - *Plugin= (filename) - read/write plugin module
561 - verify= (ipnougsamc5) - verify options
564 - replace= (always/ifnewer/ifolder/never) - replace options currently
566 - *Writer= (filename) - external write (restore) program
570 Currently options specifying compression, MD5 signatures, recursion,
571 ... of a FileSet are supplied on the Include record. These will now
572 all be collected into a FileOptions resource, which will be
573 specified on the Include in place of the options. Multiple FileOptions
574 may be specified. Since the FileOptions contain regular expressions
575 that are applied to the full filename, this will give the ability
576 to specify backup options on a file by file basis to whatever level
585 Include = compression=GZIP signature=MD5 {
594 Include = FileOptions=Opts {
605 That's a lot more to do the same thing, but it gives the ability to
606 apply options on a file by file basis. For example, suppose you
607 want to compress all files but not any file with extensions .gz or .Z.
608 You could do so as follows:
612 Include = FileOptions=NoCompress FileOptions=Opts {
620 ApplyTo = /*.?*/ # matches all files
625 # Note multiple ApplyTos are ORed
626 ApplyTo = /*.gz/ # matches .gz files */
627 ApplyTo = /*.Z/ # matches .Z files */
630 Now, since the NoCompress FileOptions is specified first on the
631 Include line, any *.gz or *.Z file will have an MD5 signature computed,
632 but will not be compressed. For all other files, the NoCompress will not
633 match, so the Opts options will be used which will include GZIP
637 - Is it necessary to provide some means of ANDing regular expressions
638 and negation? (not currently planned)
640 e.g. ApplyTo = /*.gz/ && !/big.gz/
642 - I see that Networker has a "null" module which, if specified, does not
643 backup the file, but does make an record of the file in the catalog
644 so that the catalog will reflect an exact picture of the filesystem.
645 The result is that the file can be "seen" when "browsing" the save
646 sets, but it cannot be restored.
648 Is this really useful? Should it be implemented in Bacula?
651 After implementing the above, the user will be able to specify
652 on a file by file basis (using regular expressions) what options are
653 applied for the backup.
654 ====================================
656 Done: (see kernsdone for more)
657 - Add EOM records? No, not at this time. The current system works and
659 - Add VolumeUseDuration and MaximumVolumeJobs to Pool db record and
661 - Add VOLUME_CAT_INFO to the EOS tape record (as
662 well as to the EOD record). -- No, not at this time.
663 - Put MaximumVolumeSize in Director (MaximumVolumeJobs, MaximumVolumeFiles,
665 - Enhance schedule to have 1stSat, ...
666 - Make sure catalog doesn't keep growing.
667 - On I/O error, write EOF, then try to write again ? No, keep it simple.
668 - Figure out how compress everything except .gz,... files.
669 Implement FileOptions.
670 - Put Bacula version somewhere in Job stream, probably Start Session Labels.
671 - Fix start/end blocks for File devices
672 - Make Job err if WriteBootstrap fails.
673 - Test that mod of restore options works.
674 - Test that week position schedule code works.
675 - Make BSR accept count (total files to be restored).
676 - Add code to fast seek to proper place on tape/file when doing Restore.
677 - Replace popen() and pclose() -- fail safe and timeout, no SIG dep.
678 - Add code to put VolFile in bsr for restore command.
679 - Volumes can be listed multiple times in Restore volume list.
680 - Add watchdog timeout for child processes start_child_timer()
682 - Get rid of bscan.c:534 error message (one time only).
683 - Print some statistics when get EOF on device in bscan -- feedback
684 to let user know it is working.
685 - DateWritten field on tape may be wrong.
686 - Ensure that restore of differential jobs works (check SQL).
687 - Count number of ignored messages in bscan and print when first SOS is found.
688 - Test that EndFile/Block are correctly updated at end of tape
689 (in view of new block reading code).
690 - Test watchdog child timer code.
691 - Test new BSR code (mostly done).
692 - Work more on how to to a Bacula restore beginning with
693 just a Bacula tape and a boot floppy (bare metal recovery).
694 - Restore options (overwrite, overwrite if older,
695 overwrite if newer, never overwrite, ...)
696 - Fill all fields in Vol/Job Header -- ensure that everything
697 needed is written to tape. Think about restore to Catalog
698 from tape. Client record needs improving.
699 - Implement ./configure --with-client-only
700 - Finish up static linking
701 - that restore options work in FD
702 - Backup of raw partitions
703 - Document nofollow flag
704 - Make sure restore options are documented
705 - Should we dump a SOS when starting a new tape? (no -- too complicated)
706 - Fix gethostbyname() to use gethostbyname_r() -- no added mutex
707 - Add HOST to Volume label.
708 - Need to save contents of FileSet to tape? -- no not now
709 - Fix db_get_fileset in cats/sql_get.c for multiple records.
710 - Fix catalog filename truncation in sql_get and sql_create. Use
711 only a single filename split routine.
712 - Figure out how to save the catalog (possibly a special FileSet).
713 - Figure out how to restore the catalog.