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