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