]> git.sur5r.net Git - bacula/bacula/blob - bacula/kernstodo
Doc new commands + allow mod of Verify Job
[bacula/bacula] / bacula / kernstodo
1                  Kern's ToDo List
2                 30 September 2003 
3
4 Documentation to do: (any release a little bit at a time)
5 - Document running a test version.
6 - Document query file format.
7 - Document static linking
8 - Document problems with Verify and pruning.
9 - Document how to use multiple databases.
10 - For FreeBSD typical /dev/nrsa0 and for mtx /dev/pass1
11 - VXA drives have a "cleaning required"
12   indicator, but Exabyte recommends preventive cleaning after every 75
13   hours of operation.
14 - Lookup HP cleaning recommendations.
15 - Lookup HP tape replacement recommendations (see trouble shooting autochanger)
16 - Create a man page for each binary (Debian package requirement).
17           
18 Testing to do: (painful)
19 - that ALL console command line options work and are always implemented
20 - blocksize recognition code.
21 - Test if rewind at end of tape waits for tape to rewind.
22 - Test cancel at EOM.       
23 - Test not zeroing Autochanger slot when it is wrong.
24 - Figure out how to use ssh or stunnel to protect Bacula communications.
25
26 For 1.33 Testing/Documentation:
27 - bextract is sending everything to the log file ****FIXME****
28 - Document to start higher priorty jobs before lower ones.
29 - suppress "Do not forget to mount the drive!!!" if error
30 - Document new records in Director. SDAddress SDDeviceName, SDPassword.
31   FDPassword, FDAddress, DBAddress, DBPort, DBPassword.
32 - Document new Include/Exclude ...
33 - Add test of exclusion, test multiple Include {} statements.
34 - Add counter variable test.
35 - Document ln -sf /usr/lib/libncurses.so /usr/lib/libtermcap.so
36   and install the esound-dev  package for compiling Console on 
37   SuSE.
38                 
39 For 1.32c
40
41 For 1.33
42 - Finish implementation of Verify=DiskToCatalog
43 - Change console to bconsole.
44 - Change smtp to bsmtp.
45 - Add device name to "Current Volume not acceptable because ..."
46 - Make sure that Bacula rechecks the tape after the 20 min wait.
47 - Set IO_NOWAIT on Bacula TCP/IP packets.
48 - Try doing a raw partition backup and restore by mounting a
49   Windows partition.
50 - Report CVS problems to SourceForge.
51 - Implement .consolerc for Console
52 - Is it really important to make Job name the same to find the
53   Full backup to avoid promoting an Incremental job?
54 - Start label, then run job when tape labeled, it should broadcast.
55 - Zap illegal characters in job name for mail files (e.g. /).
56 - From Lars Köllers:
57     Yes, it would allow to highly automatic the request for new tapes. If a 
58     tape is empty, bacula reads the barcodes (native or simulated), and if 
59     an unused tape is found, it runs the label command with all the 
60     necessary parameters.
61
62     By the way can bacula automatically "move" an empry/purged volume say 
63     in the "short" pool to the "long" pool if this pool runs out of volume 
64     space?
65 - Implement a move Volume from one pool to another.
66 - Either restrict the characters in a name, or fix the problem 
67   emailing with names containing / (smtp command line breaks).
68 - Eliminate ua_retention.c (retentioncmd) if possible.
69 - Eliminate orphaned jobs: dbcheck, normal pruning, delete job command.
70   Hm.  Well, there are the remaining orphaned job records:
71
72      |   105 | Llioness Save  | 0000-00-00 00:00:00 | B    | D     |        0 |             0 | f         |
73      |   110 | Llioness Save  | 0000-00-00 00:00:00 | B    | I     |        0 |             0 | f         |
74      |   115 | Llioness Save  | 2003-09-10 02:22:03 | B    | I     |        0 |             0 | A         |
75      |   128 | Catalog Save   | 2003-09-11 03:53:32 | B    | I     |        0 |             0 | C         |
76      |   131 | Catalog Save   | 0000-00-00 00:00:00 | B    | I     |        0 |             0 | f         |
77
78      As you can see, three of the five are failures.  I already deleted the
79      one restore and one other failure using the by-client option.  Deciding
80      what is an orphaned job is a tricky problem though, I agree.  All these
81      records have or had 0 files/ 0 bytes, except for the restore.  With no
82      files, of course, I don't know of the job ever actually becomes
83      associated with a Volume.
84
85      (I'm not sure if this is documented anywhere -- what are the meanings of
86      all the possible JobStatus codes?)
87
88      Looking at my database, it appears to me as though all the "orphaned"
89      jobs fit into one of two categories:
90
91      1)  The Job record has a StartTime but no EndTime, and the job is not
92          currently running;
93      or
94      2)  The Job record has an EndTime, indicating that it completed, but
95          it has no associated JobMedia record.
96
97
98      This does suggest an approach.  If failed jobs (or jobs that, for some
99      other reason, write no files) are associated with a volume via a
100      JobMedia record, then they should be purged when the associated volume
101      is purged.  I see two ways to handle jobs that are NOT associated with a
102      specific volume:
103
104      1)  purge them automatically whenever any volume is manually purged;
105      or
106      2)  add an option to the purge command to manually purge all jobs with
107          no associated volume.
108
109      I think Restore jobs also fall into category 2 above ....  so one might
110      want to make that "The Job record has an EndTime,, but no associated
111      JobMedia record, and is not a Restore job."  
112 - Implement RestoreJobRetention? Maybe better "JobRetention" in a Job,
113   which would take precidence over the Catalog "JobRetention".
114 - Implement Label Format in Add and Label console commands.
115 - make "btape /tmp" work.
116 - Make sure a rescheduled job is properly reported by status.
117 - Walk through the Pool records rather than the Job records
118   in dird.c to create/update pools.
119 - What to do about "list files job=xxx".
120 - Implement delete Job.
121 - Document need to put LabelFormat in quotes.
122 - Implement scan: for every slot it finds, zero the slot of
123   Volume other volume having that slot.
124 - When job rescheduled, status gives is waiting for Client Rufus 
125   to connect to Storage File. Dir needs to inform SD that job
126   is rescheduled.
127 - Fix get_storage_from_media_type (ua_restore) to use command line     
128   storage=
129 - Enhance "update slots" to include a "scan" feature
130   scan 1; scan 1-5; scan 1,2,4 ...  to update the catalog 
131 - Allow a slot or range of slots on the label barcodes command.
132 - Don't print "Warning: Wrong Volume mounted ..." if mounting second volume.
133 - Make Dmsg look at global before calling subroutine.
134 - Enable trace output at runtime for Win32
135 - Make sure that Volumes are recycled based on "Least recently used"
136   rather than lowest MediaId.
137 - Available volumes for autochangers (see patrick@baanboard.com 3 Sep 03 
138   and 4 Sep) scan slots.
139 - Upgrade to cygwin 1.5
140 - Get MySQL 3.23.58
141 - Get and test MySQL 4.0
142 - Do a complete audit of all pthreads_mutex, cond, ... to ensure that
143   any that are dynamically initialized are destroyed when no longer used.
144 - Write a mini-readline with history and editing.
145 - Look at how fuser works and /proc/PID/fd that is how Nic found the
146   file descriptor leak in Bacula.
147 - Implement WrapCounters in Counters.
148 - Turn on SIGHUP in dird.c and test.
149 - Use system dependent calls to get more precise info on tape errors.
150 - Add heartbeat from FD to SD if hb interval expires.
151 - Suppress read error on blank tape when doing a label.
152 - Can we dynamically change FileSets?
153 - If pool specified to label command and Label Format is specified,
154   automatically generate the Volume name.
155 - Take a careful look a the Basic recycling algorithm.  When Bacula
156   chooses, the order should be:
157    - Look for Append
158    - Look for Recycle or Purged
159    - Prune volumes
160    - Look for purged
161   Instead of using lowest media Id, find the least recently used
162   volume.
163
164   When the tape is mounted and Bacula requests the status
165   - Do everything possible to use it.
166
167   Define a "available" status, which is the currently mounted 
168   Volume and all volumes that are currently in the autochanger.
169
170 - Why can't SQL do the filename sort for restore?
171 - Is a pool specification really needed for a restore?  Yes, and
172   you may want to exclude archive Pools.
173 - Look at libkse (man kse) for FreeBSD threading.
174 - Look into Microsoft Volume Shadowcopy Service VSS for backing
175   up system state components (Active Directory, System Volume, ...)
176 - Add ExhautiveRestoreSearch
177 - Look at the possibility of loading only the necessary 
178   data into the restore tree (i.e. do it one directory at a
179   time as the user walks through the tree).
180 - Possibly use the hash code if the user selects all for a restore command.
181 - Orphaned Dir buffer at parse_conf.c:373 =>  store_dir
182 - Implement some way for the File daemon to contact the Director 
183   to start a job or pass its DHCP obtained IP number.
184 - Implement multiple Consoles.
185 - Add Console usr permissions.
186 - Fix "restore all" to bypass building the tree.
187 - Fix restore to list errors if Invalid block found, and if # files
188   restored does not match # expected.
189 - Prohibit backing up archive device (findlib/find_one.c:128)
190 - Implement Release Device in the Job resource to unmount a drive.
191 - Implement Acquire Device in the Job resource to mount a drive,
192   be sure this works with admin jobs so that the user can get
193   prompted to insert the correct tape.  Possibly some way to say to
194   run the job but don't save the files.
195 - Add JobName= to VerifyToCatalog so that all verifies can be done at the end.
196 - Implement FileOptions (see end of this document)
197 - Make things like list where a file is saved case independent for
198   Windows.
199 - Edit the Client/Storage name into authentication failure messages.
200 - Implement job in VerifyToCatalog
201 - Implement migrate
202 - Implement a PostgreSQL driver.
203 - Bacula needs to propagate SD errors.
204   > > cluster-dir: Start Backup JobId 252, Job=REUTERS.2003-08-11_15.04.12
205   > > prod4-sd: REUTERS.2003-08-11_15.04.12 Error: Write error on device 
206        /dev/nst0. ERR=Input/output error.
207   > > prod4-sd: REUTERS.2003-08-11_15.04.12 Error: Re-read of last block failed. 
208        Last block=5162 Current block=5164.
209   > > prod4-sd: End of medium on Volume "REU007" Bytes=16,303,521,933 
210
211 - Use autochanger to handle multiple devices.
212 - Fix packet too big problem. This is most likely a Windows TCP stack 
213   problem.
214 - Add SuSE install doc to list.
215 - Check and rechedk "Invalid block number"
216 - Make bextract release the drive properly between tapes 
217   so that an autochanger can be made to work.
218 - User wants to NOT backup up certain big files (email files).
219 - Maybe remove multiple simultaneous devices code in SD.
220 - On Windows with very long path names, it may be impossible to create 
221   a file (and thus restore it) because the total length is too long.
222   We must cd into the directory then create the file without the
223   full path name.
224 - lstat() is not going to work on Win32 for testing date.
225 - Something is not right in last block of fill command.
226 - Implement a Recycle command
227 - Add FileSet to command line arguments for restore.
228 - Allow multiple Storage specifications (or multiple names on
229   a single Storage specification) in the Job record. Thus a job 
230   can be backed up to a number of storage devices.
231 - Add client name to cram-md5 challenge so Director can immediately
232   verify if it is the correct client.
233 - Implement ClientRunBeforeJob and ClientRunAfterJob.
234 - Add JobLevel in FD status (but make sure it is defined).
235 - Audit all UA commands to ensure that we always prompt where possible.
236 - Restrict characters permitted in a Resource name, and don't permit
237   duplicate names.
238 - Check Jmsg in bnet, may not work, must dup bsock.
239 - Suppress Job Name in Jmsg for console
240 - Create Pools that are referenced in a Run statement at startup if possible.
241 - Use runbeforejob to unload, then reload a volume previously used,
242   then the next job run gets an error reading the drive.
243 - Make bootstrap filename unique.
244 - Test a second language e.g. french.
245 - Start working on Base jobs.
246 - Make "make binary-release" work from any directory.
247 - Implement UnsavedFiles DB record.
248 - Implement argc/argv for daemon command line scanning using table driven
249   stuff below.
250 - Implement table driven single argc/argv scanner to pickup all arguments.
251   Much like xxx_conf.c scan table.
252   keyword, handler(store_routine), store_address, code, flags, default.
253 - From Phil Stracchino:
254   It would probably be a per-client option, and would be called
255   something like, say, "Automatically purge obsoleted jobs".  What it
256   would do is, when you successfully complete a Differential backup of a
257   client, it would automatically purge all Incremental backups for that
258   client that are rendered redundant by that Differential.  Likewise,
259   when a Full backup on a client completed, it would automatically purge
260   all Differential and Incremental jobs obsoleted by that Full backup.
261   This would let people minimize the number of tapes they're keeping on
262   hand without having to master the art of retention times.
263 - Implement new serialize subroutines
264    send(socket, "string", &Vol, "uint32", &i, NULL)
265 - Scratch Pool where the volumes can be re-assigned to any Pool.
266 - Implement a M_SECURITY message class.
267 - Implement forward spacing block/file: position_device(bsr) --
268   just before read_block_from_device();
269 - When doing a Backup send all attributes back to the Director, who
270   would then figure out what files have been deleted.
271 - Currently in mount.c:236 the SD simply creates a Volume. It should have
272   explicit permission to do so.  It should also mark the tape in error
273   if there is an error.
274 - Make sure all restore counters are working correctly in the FD.
275 - SD Bytes Read is wrong.
276 - Look at ALL higher level routines that call block.c to be sure
277   they don't expect something in errmsg.
278 - Investigate doing RAW backup of Win32 partition.
279 - Add thread specific data to hold the jcr -- send error messages from
280   low level routines by accessing it and using Jmsg().
281 - Cancel waiting for Client connect in SD if FD goes away.
282
283 - Add Progress command that periodically reports the progress of
284   a job or all jobs.
285 - One block was orphaned in the SD probably after cancel.
286
287
288 - Examine Bare Metal restore problem (a FD crash exists somewhere ...).
289 - Implement timeout in response() when it should come quickly.
290 - Implement console @echo command.
291 - Implement a Slot priority (loaded/not loaded).
292 - Implement "vacation" Incremental only saves.
293 - Implement single pane restore (much like the Gftp panes).
294 - Implement Automatic Mount even in operator wait.
295 - Implement create "FileSet"?
296 - Fix watchdog pthread crash on Win32 (this is pthread_kill() Cygwin bug)
297 - Implement "scratch pool" where tapes are defined and can be
298   taken by any pool that needs them.
299 - Implement restore "current system", but take all files without
300   doing selection tree -- so that jobs without File records can
301   be restored.
302 - Implement disk spooling. Two parts: 1. Spool to disk then
303   immediately to tape to speed up tape operations. 2. Spool to
304   disk only when the tape is full, then when a tape is hung move
305   it to tape.
306 - Implement a relocatable bacula.spec 
307 - Implement dump/print label to UA
308 - Add prefixlinks to where or not where absolute links to FD.
309 - Issue message to mount a new tape before the rewind.
310 - Simplified client job initiation for portables.
311 - If SD cannot open a drive, make it periodically retry.
312 - Implement LabelTemplate (at least first cut).
313 - Add more of the config info to the tape label.
314 - Implement a Mount Command and an Unmount Command where
315   the users could specify a system command to be performed
316   to do the mount, after which Bacula could attempt to
317   read the device. This is for Removeable media such as a CDROM.
318   - Most likely, this mount command would be invoked explicitly
319   by the user using the current Console "mount" and "unmount" 
320   commands -- the Storage Daemon would do the right thing 
321   depending on the exact nature of the device.
322   - As with tape drives, when Bacula wanted a new removable
323   disk mounted, it would unmount the old one, and send a message
324   to the user, who would then use "mount" as described above 
325   once he had actually inserted the disk.
326
327 - If tape is marked read-only, then try opening it read-only rather than
328   failing, and remember that it cannot be written.
329 - Refine SD waiting output:
330     Device is being positioned
331     >     Device is being positioned for append
332     >     Device is being positioned to file x
333     > 
334 - Figure out some way to estimate output size and to avoid splitting
335   a backup across two Volumes -- this could be useful for writing CDROMs
336   where you really prefer not to have it split -- not serious.
337 - Have SD compute MD5 or SHA1 and compare to what FD computes.
338 - Make VolumeToCatalog calculate an MD5 or SHA1 from the 
339   actual data on the Volume and compare it.                  
340 - Implement Bacula plugins -- design API
341 - Make bcopy read through bad tape records.
342 - Program files (i.e. execute a program to read/write files).
343   Pass read date of last backup, size of file last time.
344 - Add Signature type to File DB record.
345 - CD into subdirectory when open()ing files for backup to
346   speed up things.  Test with testfind().
347 - Priority job to go to top of list.
348 - Why are save/restore of device different sizes (sparse?)   Yup! Fix it.
349 - Implement some way for the Console to dynamically create a job.
350 - Restore to a particular time -- e.g. before date, after date. 
351 - Solaris -I on tar for include list
352 - Need a verbose mode in restore, perhaps to bsr.
353 - bscan without -v is too quiet -- perhaps show jobs.
354 - Add code to reject whole blocks if not wanted on restore.
355 - Check if we can increase Bacula FD priorty in Win2000
356 - Make sure the MaxVolFiles is fully implemented in SD
357 - Check if both CatalogFiles and UseCatalog are set to SD.
358 - Figure out how to do a bare metal Windows restore
359 - Possibly add email to Watchdog if drive is unmounted too
360   long and a job is waiting on the drive.
361 - Restore program that errs in SD due to no tape, reports
362   OK incorrectly in output.
363 - After unmount, if restore job started, ask to mount.
364 - Convert all %x substitution variables, which are hard to remember
365   and read to %(variable-name).  Idea from TMDA.
366 - Remove NextId for SQLite. Optimize.
367 - Move all SQL statements into a single location.
368 - Add UA rc and history files.
369 - put termcap (used by console) in ./configure and
370   allow -with-termcap-dir.
371 - Enhance time and size scanning routines.
372 - Fix Autoprune for Volumes to respect need for full save.
373 - Fix Win32 config file definition name on /install
374 - Compare tape to Client files (attributes, or attributes and data) 
375 - Make all database Ids 64 bit.
376 - Write an applet for Linux.
377 - Implement new inter-daemon communications protocol.
378 - Allow console commands to detach or run in background.
379 - Fix status delay on storage daemon during rewind.
380 - Add SD message variables to control operator wait time
381   - Maximum Operator Wait
382   - Minimum Message Interval
383   - Maximum Message Interval
384 - Send Operator message when cannot read tape label.
385 - Verify level=Volume (scan only), level=Data (compare of data to file).
386   Verify level=Catalog, level=InitCatalog
387 - Events file
388 - Add keyword search to show command in Console.
389 - Events : tape has more than xxx bytes.
390 - Complete code in Bacula Resources -- this will permit
391   reading a new config file at any time.
392 - Handle ctl-c in Console
393 - Implement script driven addition of File daemon to config files.
394 - Think about how to make Bacula work better with File (non-tape) archives.
395 - Write Unix emulator for Windows.
396 - Put memory utilization in Status output of each daemon
397   if full status requested or if some level of debug on.
398 - Make database type selectable by .conf files i.e. at runtime
399 - Set flag for uname -a.  Add to Volume label.
400 - Implement throttled work queue.
401 - Restore files modified after date
402 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
403 - Implement Restore FileSet=
404 - Create a protocol.h and protocol.c where all protocol messages
405   are concentrated.
406 - Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...).
407 - Timout a job or terminate if link goes down, or reopen link and query.
408 - Concept of precious tapes (cannot be reused).
409 - Make bcopy copy with a single tape drive.
410 - Permit changing ownership during restore.
411
412 - From Phil:
413   > My suggestion:  Add a feature on the systray menu-icon menu to request
414   > an immediate backup now.  This would be useful for laptop users who may
415   > not be on the network when the regular scheduled backup is run.
416   > 
417   > My wife's suggestion: Add a setting to the win32 client to allow it to
418   > shut down the machine after backup is complete (after, of course,
419   > displaying a "System will shut down in one minute, click here to cancel"
420   > warning dialog).  This would be useful for sites that want user
421   > woorkstations to be shut down overnight to save power.
422   > 
423
424 - From Terry Manderson <terry@apnic.net>
425    jobset { # new structure
426    name = "monthlyUnixBoxen"
427    type = backup
428    level = full
429    jobs = "wakame;durian;soy;wasabi;miso" #new!
430    schedule = monthly
431    storage = DLT
432    messages = Standard
433    pool = MonthlyPool
434    priority = 10
435    }
436
437    job {
438    name = "wakame"
439     fileset = "genericUnixSet"
440    client = wakame-fd
441    }
442
443    job {
444    name = "durian"
445    fileset = "genericUnixSet"
446    client = durian-fd
447    }
448
449    job {
450    name = "soy"
451    fileset = "UnixDevelBoxSet"
452    client = soy-fd
453    }
454
455
456 - Autolabel should be specified by DIR instead of SD.
457 - Storage daemon    
458   - Add media capacity
459   - AutoScan (check checksum of tape)
460   - Format command = "format /dev/nst0"
461   - MaxRewindTime
462   - MinRewindTime
463   - MaxBufferSize
464   - Seek resolution (usually corresponds to buffer size)
465   - EODErrorCode=ENOSPC or code
466   - Partial Read error code
467   - Partial write error code
468   - Nonformatted read error
469   - Nonformatted write error
470   - WriteProtected error
471   - IOTimeout
472   - OpenRetries
473   - OpenTimeout
474   - IgnoreCloseErrors=yes
475   - Tape=yes
476   - NoRewind=yes
477 - Pool
478   - Maxwrites
479   - Recycle period
480 - Job
481   - MaxWarnings
482   - MaxErrors (job?)
483 =====
484 - FD sends unsaved file list to Director at end of job (see
485   RFC below).
486 - File daemon should build list of files skipped, and then
487   at end of save retry and report any errors.
488 - Write a Storage daemon that uses pipes and
489   standard Unix programs to write to the tape.
490   See afbackup.
491 - Need something that monitors the JCR queue and
492   times out jobs by asking the deamons where they are.
493 - Enhance Jmsg code to permit buffering and saving to disk.
494 - device driver = "xxxx" for drives.
495 - Verify from Volume
496 - Ensure that /dev/null works
497 - Need report class for messages. Perhaps
498   report resource where report=group of messages
499 - enhance scan_attrib and rename scan_jobtype, and
500   fill in code for "since" option 
501 - Director needs a time after which the report status is sent
502   anyway -- or better yet, a retry time for the job.
503 - Don't reschedule a job if previous incarnation is still running.
504 - Some way to automatically backup everything is needed????
505 - Need a structure for pending actions:
506   - buffered messages
507   - termination status (part of buffered msgs?)
508 - Drive management
509   Read, Write, Clean, Delete
510 - Login to Bacula; Bacula users with different permissions:
511    owner, group, user, quotas
512 - Store info on each file system type (probably in the job header on tape.
513   This could be the output of df; or perhaps some sort of /etc/mtab record.
514
515 Longer term to do:
516 - Design at hierarchial storage for Bacula. Migration and Clone. 
517 - Implement FSM (File System Modules).
518 - Audit M_ error codes to ensure they are correct and consistent.
519 - Add variable break characters to lex analyzer.
520   Either a bit mask or a string of chars so that
521   the caller can change the break characters.
522 - Make a single T_BREAK to replace T_COMMA, etc.
523 - Ensure that File daemon and Storage daemon can
524   continue a save if the Director goes down (this
525   is NOT currently the case). Must detect socket error,
526   buffer messages for later. 
527 - Enhance time/duration input to allow multiple qualifiers e.g. 3d2h
528 - Add ability to backup to two Storage devices (two SD sessions) at
529   the same time -- e.g. onsite, offsite.
530 - Add the ability to consolidate old backup sets (basically do a restore
531   to tape and appropriately update the catalog). Compress Volume sets.
532   Might need to spool via file is only one drive is available.
533 - Compress or consolidate Volumes of old possibly deleted files. Perhaps
534   someway to do so with every volume that has less than x% valid 
535   files.
536
537
538 Migration: Move a backup from one Volume to another
539 Clone:     Copy a backup -- two Volumes
540
541 Bacula Migration is based on Jobs (apparently Networker is file by file).
542
543 Migration triggered by:
544   Number of Jobs
545   Number of Volumes
546   Age of Jobs
547   Highwater mark (keep total size)
548   Lowwater mark
549   
550 Projects:
551             Bacula Projects Roadmap 
552                17 August 2002
553            last update 8 May 2003
554
555 Item 1:   Multiple simultaneous Jobs. (done)
556 Done -- Restore part needs better implementation to work correctly
557         Also, it needs considerable testing
558
559   What:   Permit multiple simultaneous jobs in Bacula.
560
561   Why:    An enterprise level solution needs to go fast without the
562           need for the system administrator to carefully tweak
563           timing.  Based on the benchmarks, during a full
564           backup, NetWorker typically hit 10 times the bandwidth to
565           the tape compared to Bacula--largely. This is probably due to
566           running parallel jobs and multi-threaded filling of buffers
567           and writing them to tape.  This should also make things work
568           better when you have a mix of fast and slow machines backing
569           up at the same time.
570
571   Notes:  Bacula was designed to run multiple simultaneous jobs. Thus
572           implementing this is a matter of some small cleanups and
573           careful testing.
574
575
576 Item 2:   Make the Storage daemon use intermediate file storage to buffer data.
577 Deferred -- not necessary yet -- possibly implement with Migration.
578
579   What:   If data is coming into the SD too fast, buffer it to 
580           disk if the user has configured this option.
581
582   Why:    This would be nice, especially if it more or less falls out
583           when implementing (1) above.  If not, it probably should not
584           be given a high priority because fundamentally the backup time
585           is limited by the tape bandwidth.  Even though you may finish a
586           client job quicker by spilling to disk, you still have to
587           eventually get it onto tape.  If intermediate disk buffering
588           allows us to improve write bandwidth to tape, it may make
589           sense.
590
591   Notes:  Whether or not this is implemented will depend upon performance
592           testing after item 1 is implemented.
593
594
595 Item 3:   Write the bscan program -- also write a bcopy program.
596 Done
597
598   What:   Write a program that reads a Bacula tape and puts all the 
599           appropriate data into the catalog. This allows recovery
600           from a tape that is no longer in the database, or it allows
601           re-creation of a database if lost.
602
603   Why:    This is a fundamental robustness and disaster recovery tool
604           which will increase the comfort level of a sysadmin
605           considering adopting Bacula.
606
607   Notes:  A skeleton of this program already exists, but much work
608           needs to be done. Implementing this will also make apparent
609           any deficiencies in the current Bacula tape format.
610
611
612 Item 4:   Implement Base jobs.
613
614   What:   A base job is sort of like a Full save except that you 
615           will want the FileSet to contain only files that are unlikely
616           to change in the future (i.e. a snapshot of most of your
617           system after installing it). After the base job has been run,
618           when you are doing a Full save, you can specify to exclude
619           all files saved by the base job that have not been modified.
620
621   Why:    This is something none of the competition does, as far as we know
622           (except BackupPC, which is a Perl program that saves to disk
623           only).  It is big win for the user, it makes Bacula stand out
624           as offering a unique optimization that immediately saves time
625           and money.
626
627   Notes:  Big savings in tape usage. Will require more resources because
628           the e. DIR must send FD a list of files/attribs, and the FD must
629           search the list and compare it for each file to be saved.
630
631
632 Item 5:   Implement Label templates
633 Done 
634
635   What:   This is a mechanism whereby Bacula can automatically create
636           a tape label for new tapes according to a detailed specification
637           provided by the user.
638
639   Why:    It is a major convenience item for folks who use automated label
640           creation.
641
642   Notes:  Bacula already has a working form of automatic tape label
643           creation, but it is very crude. The design for the complete
644           tape labeling project is already documented in the manual.
645
646
647 Item 6:   Write a regression script.
648 Done --   Continue to expand its testing.
649
650   What:   This is an automatic script that runs and tests as many features
651           of Bacula as possible. The output is compared to previous
652           versions of Bacula and any differences are reported.
653
654   Why:    This is an enormous help in preventing introduction of new
655           errors in parts of the program that already work correctly.
656
657   Notes:  This probably should be ranked higher, it's something the typical
658           user doesn't see.  Depending on how it's implemented, it may
659           make sense to defer it until the archival tape format and
660           user interface mature.
661
662
663 Item 7:   GUI for interactive restore
664 Item 8:   GUI for interactive backup
665
666   What:   The current interactive restore is implemented with a tty
667           interface. It would be much nicer to be able to "see" the
668           list of files backed up in typical GUI tree format.
669           The same mechanism could also be used for creating 
670           ad-hoc backup FileSets (item 8).
671
672   Why:    Ease of use -- especially for the end user.
673
674   Notes:  Rather than implementing in Gtk, we probably should go directly
675           for a Browser implementation, even if doing so meant the
676           capability wouldn't be available until much later.  Not only
677           is there the question of Windows sites, most
678           Solaris/HP/IRIX, etc,  shops can't currently run Gtk programs
679           without installing lots of stuff admins are very wary about.
680           Real sysadmins will always use the command line anyway, and
681           the user who's doing an interactive restore or backup of his
682           own files will in most cases be on a Windows machine running
683           Exploder.
684
685
686 Item 9:   Add SSL to daemon communications.
687
688   What:   This provides for secure communications between the daemons.
689
690   Why:    This would allow doing backup across the Internet without
691           privacy concerns (or with much less concern).
692
693   Notes:  The vast majority of near term potential users will be backing up
694           a single site over a LAN and, correctly or not, they probably
695           won't be concerned with security, at least not enough to go to
696           the trouble to set up keys, etc. to screw things down.  We suspect
697           that many users genuinely interested in multi-site backup
698           already run some form of VPN software in their internetwork
699           connections, and are willing to delegate security to that layer.
700
701
702 Item 10:  Define definitive tape format.
703 Done (version 1.27)
704
705   What:   Define that definitive tape format that will not change 
706           for the next millennium.
707
708   Why:    Stability, security.
709
710   Notes:  See notes for item 11 below.
711
712
713 Item 11:  New daemon communication protocol.
714
715   What:   The current daemon to daemon protocol is basically an ASCII
716           printf() and sending the buffer. On the receiving end, the
717           buffer is sscanf()ed to unpack it. The new scheme would
718           be a binary format that allows quick packing and unpacking
719           of any data type with named fields.
720
721   Why:    Using binary packing would be faster. Named fields will permit
722           error checking to ensure that what is sent is what the 
723           receiver really wants.
724
725   Notes:  These are internal improvements in the interest of the
726           long-term stability and evolution of the program.  On the one
727           hand, the sooner they're done, the less code we have to rip
728           up when the time comes to install them.  On the other hand, they
729           don't bring an immediately perceptible benefit to potential
730           users.  Item 10 and possibly item 11 should be deferred until Bacula
731           is well established with a growing user community more or
732           less happy with the feature set.  At that time, it will make a
733           good "next generation" upgrade in the interest of data
734           immortality.
735
736
737
738
739 ======================================================
740         Base Jobs design
741 It is somewhat like a Full save becomes an incremental since
742 the Base job (or jobs) plus other non-base files.
743 Need:
744 - New BaseFile table that contains:
745     JobId, BaseJobId, FileId (from Base).
746   i.e. for each base file that exists but is not saved because
747   it has not changed, the File daemon sends the JobId, BaseId,
748   and FileId back to the Director who creates the DB entry.
749 - To initiate a Base save, the Director sends the FD 
750   the FileId, and full filename for each file in the Base.
751 - When the FD finds a Base file, he requests the Director to
752   send him the full File entry (stat packet plus MD5), or
753   conversely, the FD sends it to the Director and the Director
754   says yes or no. This can be quite rapid if the FileId is kept
755   by the FD for each Base Filename.          
756 - It is probably better to have the comparison done by the FD
757   despite the fact that the File entry must be sent across the
758   network.
759 - An alternative would be to send the FD the whole File entry
760   from the start. The disadvantage is that it requires a lot of
761   space. The advantage is that it requires less communications
762   during the save.
763 - The Job record must be updated to indicate that one or more
764   Bases were used.
765 - At end of Job, FD returns:   
766    1. Count of base files/bytes not written to tape (i.e. matches)
767    2. Count of base file that were saved i.e. had changed.
768 - No tape record would be written for a Base file that matches, in the
769   same way that no tape record is written for Incremental jobs where
770   the file is not saved because it is unchanged.
771 - On a restore, all the Base file records must explicitly be
772   found from the BaseFile tape. I.e. for each Full save that is marked
773   to have one or more Base Jobs, search the BaseFile for all occurrences
774   of JobId.
775 - An optimization might be to make the BaseFile have:
776      JobId
777      BaseId
778      FileId
779   plus
780      FileIndex
781   This would avoid the need to explicitly fetch each File record for
782   the Base job.  The Base Job record will be fetched to get the
783   VolSessionId and VolSessionTime.
784 =========================================================  
785
786   
787
788 =============================================================
789
790                 Request For Comments For File Backup Options
791                    10 November 2002
792
793 Subject: File Backup Options
794
795 Problem: 
796   A few days ago, a Bacula user who is backing up to file volumes and
797   using compression asked if it was possible to suppress compressing
798   all .gz files since it was a waste of CPU time. Although Bacula
799   currently permits using different options (compression, ...) on
800   a directory by directory basis, it cannot do it on a file by 
801   file basis, which is clearly what was desired.   
802
803 Proposed Implementation:
804   To solve this problem, I propose the following:
805
806   - Add a new Director resource type called Options.  
807
808   - The Options resource will have records for all
809     options that can currently be specified on the Include record 
810     (in a FileSet).  Examples below.
811
812   - The Options resource will permit an exclude option as well
813     as a number of additional options.
814
815   - The heart of the Options resource is the ability to
816     supply any number of Match records which specify POSIX
817     regular expressions.  These Match regular expressions are
818     applied to the fully qualified filename (path and all). If
819     one matches, then the Options will be used.
820
821   - When an Match specification matches an included file, the
822     options specified in the Options resource will override
823     the default options specified on the Include record.
824
825   - Include records will be modified to permit referencing one or
826     more Options resources.  The Options will be used
827     in the order listed on the Include record and the first
828     one that matches will be applied.
829
830   - Options (or specifications) currently supplied on the Include
831     record will be deprecated (i.e. removed in a later version a
832     year or so from now).
833
834   - The Exclude record will be deprecated as the same functionality
835     can be obtained by using an Exclude = yes in the Options.
836
837 Options records:
838   The following records can appear in the Options resource. An
839   asterisk preceding the name indicates a feature not currently
840   implemented.
841
842   For Backup Jobs:
843     - Compression= (GZIP, ...)
844     - Signature=   (MD5, SHA1, ...)
845     - *Encryption=
846     - OneFs=      (yes/no)    - remain on one filesystem
847     - Recurse=    (yes/no)    - recurse into subdirectories
848     - Sparse=     (yes/no)    - do sparse file backup
849     - *Exclude=   (yes/no)    - exclude file from being saved
850     - *Reader=    (filename)  - external read (backup) program
851     - *Plugin=    (filename)  - read/write plugin module
852
853   For Verify Jobs:
854     - verify=     (ipnougsamc5) - verify options
855
856   For Restore Jobs:
857     - replace= (always/ifnewer/ifolder/never) - replace options currently
858                                                 implemented in 1.31
859     - *Writer= (filename)   - external write (restore) program
860
861
862 Implementation:
863   Currently options specifying compression, MD5 signatures, recursion,
864   ... of a FileSet are supplied on the Include record. These will now
865   all be collected into a Options resource, which will be
866   specified in the Include in place of the options. Multiple Options
867   may be specified.  Since the Options may contain regular expressions
868   that are applied to the full filename, this will give the ability
869   to specify backup options on a file by file basis to whatever level
870   of detail you wish.
871
872 Example:
873
874   Today:
875
876     FileSet {
877       Name = "FullSet"
878       Include = compression=GZIP signature=MD5 {
879         /
880       }
881     }
882
883   Proposal:
884
885     FileSet {
886       Name = "FullSet"
887       Include {
888         Compression = GZIP;
889         Signature = MD5
890         Match = /*.?*/                # matches all files.
891         File = /
892       }
893     }
894
895   That's a lot more to do the same thing, but it gives the ability to
896   apply options on a file by file basis.  For example, suppose you
897   want to compress all files but not any file with extensions .gz or .Z.
898   In that case, you will need to group two sets of options using
899   the Options resource as follows:
900
901
902     FileSet {
903       Name = "FullSet"
904       Include {
905         Options {
906           Signature = MD5
907           # Note multiple Matches are ORed
908           Match = /*.gz/   # matches .gz files */
909           Match = /*.Z/    # matches .Z files */
910         }
911         Options {
912           Compression = GZIP
913           Signature = MD5
914           Match = /*.?*/   # matches all files
915         }
916         File = /
917       }
918     }
919
920   Now, since the no Compression option is specified in the
921   first group of Options, *.gz or *.Z file will have an MD5 signature computed,
922   but will not be compressed. For all other files, the *.gz *.Z will not
923   match, so the second group of options will be used which will include GZIP
924   compression.
925
926 Questions:
927   - Is it necessary to provide some means of ANDing regular expressions
928     and negation?  (not currently planned)
929
930     e.g.  Match = /*.gz/ && !/big.gz/
931
932   - I see that Networker has a "null" module which, if specified, does not 
933     backup the file, but does make an record of the file in the catalog
934     so that the catalog will reflect an exact picture of the filesystem.
935     The result is that the file can be "seen" when "browsing" the save
936     sets, but it cannot be restored.
937     
938     Is this really useful?  Should it be implemented in Bacula?
939   
940 Results:
941   After implementing the above, the user will be able to specify
942   on a file by file basis (using regular expressions) what options are
943   applied for the backup.
944
945
946 =============================================
947
948 ========================================================== 
949     Unsaved File design
950 For each Incremental job that is run, there may be files that
951 were found but not saved because they were locked (this applies
952 only to Windows). Such a system could send back to the Director
953 a list of Unsaved files.
954 Need:
955 - New UnSavedFiles table that contains:
956   JobId
957   PathId
958   FilenameId
959 - Then in the next Incremental job, the list of Unsaved Files will be
960   feed to the FD, who will ensure that they are explicitly chosen even
961   if standard date/time check would not have selected them.
962 =============================================================
963
964
965 Done: (see kernsdone for more)
966 - Implement new alist in FileSet scanning.
967 - bls should continue reading even if it finds Win32 data on the tape.
968   The error should be Warning rather the Error.
969 - Add user configurable timeout for connecting to SD.
970 - Unsaved Flag in Job record (use JobMissingFiles).
971 - Base Flag in Job record.
972 - Configure mtx-changer to have correct path to mtx.
973 - Add all command line arguments to "update", e.g. slot=nn volStatus=append, ...
974 - Make some way so that if a machine is skipped because it is not up 
975   that Bacula will continue retrying for a specified period of time --
976   periodically.
977 - Implement all command line args on run.
978 - Implement command line "restore" args.
979 - Implement "restore current select=no"
980 - Restore file modified before date
981 - Restore -- do nothing but show what would happen
982 - Add estimate to Console commands
983 - Use read_record.c in SD code.
984 - Fix read_record to handle multiple sessions.
985 - Tip from Steve Allam
986   mt -f /dev/nst0 defblksize 0
987 - Document "status" in the console.
988 - Document driving console from shell script.
989 - Write JobMedia records with max file size is reached on tape.
990 - Handle the case of multiple JobMedia records pending (i.e. the
991   thread is slow and multiple situations requiring a JobMedia
992   record occur).
993 - Do performance analysis on the restore tree routines.
994 - Fix maximum file size (block.c) to generate JobMedia records.
995 - Make the default file size 1GB on the tape.
996 - Implement forward spacing between files.
997 - Add Machine type (Linux/Windows) to Status report for daemons. 
998   Look at src/host.h
999 - Use repositioning at the beginning of the tape.                   
1000 - Do full check the command line args in update (e.g. VolStatus ...).
1001 - Specify list of files to restore
1002 - Implement ClientRunBeforeJob and ClientRunAfterJob.
1003 - Make | and < work on FD side.
1004 - Check to see if "blocked" is set during restore.
1005 - Figure out what is interrupting sql command in console.
1006 - Make new job print warning User Unmounted Tape.
1007 - Test recycling and purging (code changed in db_find_next_volume and
1008   in recycle.c).
1009 - Document SDConnectTimeout (in FD).
1010 - Add restore by filename test.
1011 - Document restore by files.
1012 - Make variable expansion work correctly.
1013 - Implement List Volume Job=xxx  or List scheduled volumes or Status Director 
1014 - Copy static programs into install directory.
1015 - Think about changing Storage resource Device record to be
1016   SDDeviceName.
1017 - Add RunBeforeJob and RunAfterJob to the Client program.
1018 - Need return status on read_cb() from read_records(). Need multiple
1019   records -- one per Job, maybe a JCR or some other structure with
1020   a block and a record.
1021 - LabelFormat on tape volume apparently creates the db record but 
1022   never actually labels the volume.
1023 - Recycling a volume when two jobs are using it is going to break. Fixed.
1024 - Document list nextvol and new format status dir.
1025 - Client files in Win32 with Unix eol conventions doesn't work.
1026 - Either fix or document that fill command in btape can be
1027   compressed enormously by the hardware - a 36GB tape wrote 750GB!
1028 - Add multiple character duration qualifiers.
1029 - Require some modifer.
1030 - Restrict characters permitted in a Resource name, and don't permit
1031   duplicate names.
1032 - Figure out some way to ignore or get past checksum errors in
1033   reading.
1034 - The SD spooling file gets created even if it is not used.
1035 - Look at Cleaning tape in ua_label.c for media create/update 
1036 - Add regression testing to the manual
1037 - End time: in job output of rescheduled job is time of first run.
1038 - Document list nextvol and status output.
1039 - Separate Dir heartbeat in FD from the SD heartbeat.
1040 - Fix sparse file handeling so that it always reads a multiple
1041   of 512. Currently, it subtracts 8 bytes (for faddr).
1042   Kludged with #ifdef for FreeBSD.
1043 - Document that Volume pruning can delete last Full backup and
1044   hence you will not have a valid backup.
1045 - Clarify the fact that having the Bacula cygwin1.dll loaded
1046   is not the same as having cygwin installed.
1047 - Document that it is safe to use the drive when the lights stop flashing.
1048 - Document all the status codes JobLevel, JobType, JobStatus.
1049 - Add GUI interface to manual
1050 - Combine the 3 places that search run records for the next
1051   job. Use find_job_pool() modified in ua_output.c
1052 - Test connect timeouts.
1053 - Fix FreeBSD build with tcp_wrapper -- should not have -lnsl
1054 - Implement fast block rejection.
1055 - I want to restore by file to some date.
1056 ---- 1.32b released
1057 - Figure out a way to move Volumes from one pool to another.
1058 - Implement a RunAfterFailedJob
1059 - Limit the number of block checksum/header BB01, ... errors printed.
1060 - If last Full back is purged and an Incremental or Differential remains,
1061   Bacula does not promote the Incremental to a Full.
1062 - Document verify_disk_to_catalog
1063 - Document delete job command.
1064 - Document update volume pool and other command line keywords.
1065 - Add VerifyJob to "run" summary (yes/mod/no) prompt.
1066