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