]> git.sur5r.net Git - bacula/bacula/blob - bacula/kernstodo
Add error jcr to read_block and print errors
[bacula/bacula] / bacula / kernstodo
1                  Kern's ToDo List
2                   20 May  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           
18 Testing to do: (painful)
19 - that ALL console command line options work and are always implemented
20 - blocksize recognition code.
21 - multiple simultaneous Volumes
22 - Test if rewind at end of tape waits for tape to rewind.
23 - Test cancel at EOM.       
24
25 - Figure out how to use ssh or stunnel to protect Bacula communications.
26
27 For 1.31 release:
28 - The bsr for Dan's job has file indexes covering the whole range rather
29   than only the range contained on the volume.
30   Constrain FileIndex to be within range for Volume.
31 - Don't zero the Slot when the wrong volume is found -- simply ask
32   the operator.
33 - Add SDWriteSeqNo to SD, and probably Read on FD side.
34 - Make sure all restore counters are working correctly in the FD.
35 - When all cassettes in magazine are used, got:
36   22-May-2003 18:24 undef-sd: 3304 Autochanger "load slot 1" status is OK.
37   22-May-2003 18:24 undef-sd: NightlySave.2003-05-22_14.08.16 Warning: mount.c:245 Director wanted Volume "TestVolume0009".
38       Current Volume "TestVolume0005" not acceptable because:
39       1998 Volume "TestVolume0005" not Append or Recycle.
40   22-May-2003 18:24 undef-sd: NightlySave.2003-05-22_14.08.16 Error: Autochanger Volume "TestVolume0009" not found in slot 1.
41       Setting slot to zero in catalog.
42   22-May-2003 18:24 undef-sd: Please mount Volume "TestVolume0009" on Storage Device "ARCHIVE 4586" for Job NightlySave.2003-05-22_14
43   .08.16
44   Use "mount" command to release Job.
45   22-May-2003 19:24 undef-sd: Please mount Volume "TestVolume0009" on Storage Device "ARCHIVE 4586" for Job NightlySave.2003-05-22_14
46   .08.16
47   Use "mount" command to release Job.
48
49 - SD Bytes Read is wrong.
50 - Configure mtx-changer to have correct path to mtx.
51 - Look at ALL higher level routines that call block.c to be sure
52   they don't expect something in errmsg.
53 - Fix Verify VolumeToCatalog to use BSRs -- it is broken.
54 - Use switch() in backup.c and restore.c in FD instead of giant if statement.
55 - Replace do_shell_expansion() with bpipe code.
56 - Investigate doing RAW backup of Win32 partition.
57 - Add JobName= to VerifyToCatalog so that all verifies can be done at the end.
58 - Add thread specific data to hold the jcr -- send error messages from
59   low level routines by accessing it and using Jmsg().
60 - Default duration with no qualifier is sec should be 1 day
61 - Find a solution for the multiple FileSet problem (when it is changed). Add date?
62 - Cancel waiting for Client connect in SD if FD goes away.
63 - Testing Tibs job erred and hung director on Storage resource.  This was
64   because there were a whole pile of jobs hanging around in the SD  
65   waiting for a connection from the FD that was never coming.
66 - Make restore more robust in counting error and not immediately bailing
67   out. Also print error message once, but try to continue.
68 - Add code to check that blocks are sequential on restore.
69 - File the Automatically selected: xxx
70   to say Automatically selected Pool: xxx
71 - Should Bacula make an Append tape as Purged when purging?
72 - Shell expansion fails for working_directory in SD from time to time.
73 - Possibly update all client records at startup.
74
75 - Implement MTIOCERRSTAT on FreeBSD to clear tape error conditions.
76
77 - Add Progress command that periodically reports the progress of
78   a job or all jobs.
79 - Implement "Reschedule OnError=yes interval=nnn times=xxx"
80 - One block was orphaned in the SD probably after cancel.
81 - Add all command line arguments to "update", e.g. slot=nn volStatus=append, ...
82
83 - Implement argc/argv for daemon command line scanning using table driven
84   stuff below.
85 - Implement table driven single argc/argv scanner to pickup all arguments.
86   Much like xxx_conf.c scan table.
87   keyword, handler(store_routine), store_address, code, flags, default.
88
89 - Examine Bare Metal restore problem (a FD crash exists somewhere ...).
90 - Test multiple simultaneous Volumes
91 - Document FInclude ...
92 - Implement timeout in response() when it should come quickly.
93 - Implement console @echo command.
94 - Implement a Slot priority (loaded/not loaded).
95 - Implement "vacation" Incremental only saves.
96 - Implement single pane restore (much like the Gftp panes).
97 - Implement Automatic Mount even in operator wait.
98 - Implement create "FileSet"?
99 - Implement Release Device in the Job resource to unmount a drive.
100 - Implement Acquire Device in the Job resource to mount a drive,
101   be sure this works with admin jobs so that the user can get
102   prompted to insert the correct tape.  Possibly some way to say to
103   run the job but don't save the files.
104 - Implement all command line args on run.
105 - Implement command line "restore" args.
106 - Implement "restore current select=no"
107 - Fix watchdog pthread crash on Win32 (this is pthread_kill() Cygwin bug)
108 - Implement "scratch pool" where tapes are defined and can be
109   taken by any pool that needs them.
110 - Implement restore "current system", but take all files without
111   doing selection tree -- so that jobs without File records can
112   be restored.
113 - Make | and < work on FD side.
114 - Pass prefix_links to FD.
115 - Implement a M_SECURITY message class.
116 - Implement disk spooling. Two parts: 1. Spool to disk then
117   immediately to tape to speed up tape operations. 2. Spool to
118   disk only when the tape is full, then when a tape is hung move
119   it to tape.
120 - From Phil Stracchino:
121   It would probably be a per-client option, and would be called
122   something like, say, "Automatically purge obsoleted jobs".  What it
123   would do is, when you successfully complete a Differential backup of a
124   client, it would automatically purge all Incremental backups for that
125   client that are rendered redundant by that Differential.  Likewise,
126   when a Full backup on a client completed, it would automatically purge
127   all Differential and Incremental jobs obsoleted by that Full backup.
128   This would let people minimize the number of tapes they're keeping on
129   hand without having to master the art of retention times.
130 - Implement a relocatable bacula.spec 
131 - Allow multiple Storage specifications (or multiple names on
132   a single Storage specification) in the Job record. Thus a job 
133   can be backed up to a number of storage devices.
134 - Implement dump/print label to UA
135 - Add prefixlinks to where or not where absolute links to FD.
136 - Look at Python for a Bacula scripting language -- www.python.org
137 - Issue message to mount a new tape before the rewind.
138 - Simplified client job initiation for portables.
139 - If SD cannot open a drive, make it periodically retry.
140 - Implement LabelTemplate (at least first cut).
141 - Add more of the config info to the tape label.
142 - Implement a Mount Command and an Unmount Command where
143   the users could specify a system command to be performed
144   to do the mount, after which Bacula could attempt to
145   read the device. This is for Removeable media such as a CDROM.
146   - Most likely, this mount command would be invoked explicitly
147   by the user using the current Console "mount" and "unmount" 
148   commands -- the Storage Daemon would do the right thing 
149   depending on the exact nature of the device.
150   - As with tape drives, when Bacula wanted a new removable
151   disk mounted, it would unmount the old one, and send a message
152   to the user, who would then use "mount" as described above 
153   once he had actually inserted the disk.
154
155 - Make some way so that if a machine is skipped because it is not up 
156   that Bacula will continue retrying for a specified period of time --
157   periodically.
158 - If tape is marked read-only, then try opening it read-only rather than
159   failing, and remember that it cannot be written.
160 - Refine SD waiting output:
161     Device is being positioned
162     >     Device is being positioned for append
163     >     Device is being positioned to file x
164     > 
165 - Figure out some way to estimate output size and to avoid splitting
166   a backup across two Volumes -- this could be useful for writing CDROMs
167   where you really prefer not to have it split -- not serious.
168 - Add RunBeforeJob and RunAfterJob to the Client program.
169 - Have SD compute MD5 or SHA1 and compare to what FD computes.
170 - Make VolumeToCatalog calculate an MD5 or SHA1 from the 
171   actual data on the Volume and compare it.                  
172 - Implement FileOptions (see end of this document)
173 - Implement Bacula plugins -- design API
174 - Make bcopy read through bad tape records.
175 - Fix read_record to handle multiple sessions.
176 - Program files (i.e. execute a program to read/write files).
177   Pass read date of last backup, size of file last time.
178 - Add Signature type to File DB record.
179 - Make Restore report an error if FD or SD term codes are not OK.
180 - CD into subdirectory when open()ing files for backup to
181   speed up things.  Test with testfind().
182 - Priority job to go to top of list.
183 - Find out why Full saves run slower and slower (hashing?)
184 - Why are save/restore of device different sizes (sparse?)   Yup! Fix it.
185 - Implement some way for the Console to dynamically create a job.
186 - Restore to a particular time -- e.g. before date, after date. 
187 - Solaris -I on tar for include list
188 - Prohibit backing up archive device (findlib/find_one.c:128)
189 - Need a verbose mode in restore, perhaps to bsr.
190 - bscan without -v is too quiet -- perhaps show jobs.
191 - Add code to reject whole blocks if not wanted on restore.
192 - Start working on Base jobs.
193 - Check if we can increase Bacula FD priorty in Win2000
194 - Make sure the MaxVolFiles is fully implemented in SD
195 - Check if both CatalogFiles and UseCatalog are set to SD.
196 - Need return status on read_cb() from read_records(). Need multiple
197   records -- one per Job, maybe a JCR or some other structure with
198   a block and a record.
199 - Figure out how to do a bare metal Windows restore
200 - Possibly add email to Watchdog if drive is unmounted too
201   long and a job is waiting on the drive.
202 - Use read_record.c in SD code.
203 - Why don't we get an error message from Win32 FD when bootstrap 
204   file cannot be created for restore command?
205 - When Marking a file in Restore that is a hard link, also
206   mark the link so that the data will be reloaded.
207 - Restore program that errors in SD due to no tape reports
208   OK incorrectly in output.
209 - After unmount, if restore job started, ask to mount.
210 - Convert all %x substitution variables, which are hard to remember
211   and read to %(variable-name).  Idea from TMDA.
212 - Add JobLevel in FD status (but make sure it is defined).
213 - Make Pool resource handle Counter resources.
214 - Remove NextId for SQLite. Optimize.
215 - Move all SQL statements into a single location.
216 - Add UA rc and history files.
217 - put termcap (used by console) in ./configure and
218   allow -with-termcap-dir.
219 - Enhance time and size scanning routines.
220 - Fix Autoprune for Volumes to respect need for full save.
221 - Fix Win32 config file definition name on /install
222 - No READLINE_SRC if found in alternate directory.
223 - Test a second language e.g. french.
224 - Compare tape to Client files (attributes, or attributes and data) 
225 - Make all database Ids 64 bit.
226 - Write an applet for Linux.
227 - Add estimate to Console commands
228 - Find solution to blank filename (i.e. path only) problem.
229 - Implement new daemon communications protocol.
230 - Remove PoolId from Job table, it exists in Media.
231 - Allow console commands to detach or run in background.
232 - Fix status delay on storage daemon during rewind.
233 - Add SD message variables to control operator wait time
234   - Maximum Operator Wait
235   - Minimum Message Interval
236   - Maximum Message Interval
237 - Send Operator message when cannot read tape label.
238 - Verify level=Volume (scan only), level=Data (compare of data to file).
239   Verify level=Catalog, level=InitCatalog
240 - Events file
241 - Add keyword search to show command in Console.
242 - Fix Win2000 error with no messages during startup.
243 - Events : tape has more than xxx bytes.
244 - Restrict characters permitted in a Resource name.
245 - Complete code in Bacula Resources -- this will permit
246   reading a new config file at any time.
247 - Handle ctl-c in Console
248 - Implement script driven addition of File daemon to config files.
249 - Think about how to make Bacula work better with File (non-tape) archives.
250 - Write Unix emulator for Windows.
251 - Implement new serialize subroutines
252    send(socket, "string", &Vol, "uint32", &i, NULL)
253 - Audit all UA commands to ensure that we always prompt where possible.
254 - If ./btape is called without /dev, assume argument is a Storage resource name.
255 - Put memory utilization in Status output of each daemon
256   if full status requested or if some level of debug on.
257 - Make database type selectable by .conf files i.e. at runtime
258 - Set flag for uname -a.  Add to Volume label.
259 - Implement throttled work queue.
260 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
261 - Restore files modified after date
262 - Restore file modified before date
263 - Emergency restore info:
264   - Backup Bacula
265   - Backup working directory
266   - Backup Catalog
267 - Restore -- do nothing but show what would happen
268 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
269 - Implement Restore FileSet=
270 - Create a protocol.h and protocol.c where all protocol messages
271   are concentrated.
272 - Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...).
273 - Timout a job or terminate if link goes down, or reopen link and query.
274 - Find general solution for sscanf size problems (as well
275   as sprintf. Do at run time?
276 - Concept of precious tapes (cannot be reused).
277 - Make bcopy copy with a single tape drive.
278 - Permit changing ownership during restore.
279
280 - Autolabel should be specified by DIR instead of SD.
281 - Find out how to get the system tape block limits, e.g.:
282   Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.  
283   Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
284 - Storage daemon    
285   - Add media capacity
286   - AutoScan (check checksum of tape)
287   - Format command = "format /dev/nst0"
288   - MaxRewindTime
289   - MinRewindTime
290   - MaxBufferSize
291   - Seek resolution (usually corresponds to buffer size)
292   - EODErrorCode=ENOSPC or code
293   - Partial Read error code
294   - Partial write error code
295   - Nonformatted read error
296   - Nonformatted write error
297   - WriteProtected error
298   - IOTimeout
299   - OpenRetries
300   - OpenTimeout
301   - IgnoreCloseErrors=yes
302   - Tape=yes
303   - NoRewind=yes
304 - Pool
305   - Maxwrites
306   - Recycle period
307 - Job
308   - MaxWarnings
309   - MaxErrors (job?)
310 =====
311 - FD sends unsaved file list to Director at end of job (see
312   RFC below).
313 - File daemon should build list of files skipped, and then
314   at end of save retry and report any errors.
315 - Write a Storage daemon that uses pipes and
316   standard Unix programs to write to the tape.
317   See afbackup.
318 - Need something that monitors the JCR queue and
319   times out jobs by asking the deamons where they are.
320 - Enhance Jmsg code to permit buffering and saving to disk.
321 - device driver = "xxxx" for drives.
322 - restart: paranoid: read label fsf to
323   eom read append block, and go
324   super-paranoid: read label, read all files
325   in between, read append block, and go
326   verify: backspace, read append block, and go
327   permissive: same as above but frees drive
328   if tape is not valid.
329 - Verify from Volume
330 - Ensure that /dev/null works
331 - Need report class for messages. Perhaps
332   report resource where report=group of messages
333 - enhance scan_attrib and rename scan_jobtype, and
334   fill in code for "since" option 
335 - Director needs a time after which the report status is sent
336   anyway -- or better yet, a retry time for the job.
337   Don't reschedule a job if previous incarnation is still running.
338 - Some way to automatically backup everything is needed????
339 - Need a structure for pending actions:
340   - buffered messages
341   - termination status (part of buffered msgs?)
342 - Drive management
343   Read, Write, Clean, Delete
344 - Login to Bacula; Bacula users with different permissions:
345    owner, group, user, quotas
346 - Store info on each file system type (probably in the job header on tape.
347   This could be the output of df; or perhaps some sort of /etc/mtab record.
348
349 Longer term to do:
350 - Design at hierarchial storage for Bacula. Migration and Clone. 
351 - Implement FSM (File System Modules).
352 - Identify unchanged or "system" files and save them to a
353   special tape thus removing them from the standard 
354   backup FileSet -- BASE backup.
355 - Audit M_ error codes to ensure they are correct and consistent.
356 - Add variable break characters to lex analyzer.
357   Either a bit mask or a string of chars so that
358   the caller can change the break characters.
359 - Make a single T_BREAK to replace T_COMMA, etc.
360 - Ensure that File daemon and Storage daemon can
361   continue a save if the Director goes down (this
362   is NOT currently the case). Must detect socket error,
363   buffer messages for later. 
364 - Enhance time/duration input to allow multiple qualifiers e.g. 3d2h
365 - Add ability to backup to two Storage devices (two SD sessions) at
366   the same time -- e.g. onsite, offsite.
367 - Add the ability to consolidate old backup sets (basically do a restore
368   to tape and appropriately update the catalog). Compress Volume sets.
369   Might need to spool via file is only one drive is available.
370 - Compress or consolidate Volumes of old possibly deleted files. Perhaps
371   someway to do so with every volume that has less than x% valid 
372   files.
373
374
375 Migration: Move a backup from one Volume to another
376 Clone:     Copy a backup -- two Volumes
377
378 Bacula Migration is based on Jobs (apparently Networker is file by file).
379
380 Migration triggered by:
381   Number of Jobs
382   Number of Volumes
383   Age of Jobs
384   Highwater mark (keep total size)
385   Lowwater mark
386   
387 Projects:
388             Bacula Projects Roadmap 
389                17 August 2002
390            last update 8 May 2003
391
392 Item 1:   Multiple simultaneous Jobs. (done)
393 Done -- Restore part needs better implementation to work correctly
394         Also, it needs considerable testing
395
396   What:   Permit multiple simultaneous jobs in Bacula.
397
398   Why:    An enterprise level solution needs to go fast without the
399           need for the system administrator to carefully tweak
400           timing.  Based on the benchmarks, during a full
401           backup, NetWorker typically hit 10 times the bandwidth to
402           the tape compared to Bacula--largely. This is probably due to
403           running parallel jobs and multi-threaded filling of buffers
404           and writing them to tape.  This should also make things work
405           better when you have a mix of fast and slow machines backing
406           up at the same time.
407
408   Notes:  Bacula was designed to run multiple simultaneous jobs. Thus
409           implementing this is a matter of some small cleanups and
410           careful testing.
411
412
413 Item 2:   Make the Storage daemon use intermediate file storage to buffer data.
414 Deferred -- not necessary yet.
415
416   What:   If data is coming into the SD too fast, buffer it to 
417           disk if the user has configured this option.
418
419   Why:    This would be nice, especially if it more or less falls out
420           when implementing (1) above.  If not, it probably should not
421           be given a high priority because fundamentally the backup time
422           is limited by the tape bandwidth.  Even though you may finish a
423           client job quicker by spilling to disk, you still have to
424           eventually get it onto tape.  If intermediate disk buffering
425           allows us to improve write bandwidth to tape, it may make
426           sense.
427
428   Notes:  Whether or not this is implemented will depend upon performance
429           testing after item 1 is implemented.
430
431
432 Item 3:   Write the bscan program -- also write a bcopy program.
433 Done
434
435   What:   Write a program that reads a Bacula tape and puts all the 
436           appropriate data into the catalog. This allows recovery
437           from a tape that is no longer in the database, or it allows
438           re-creation of a database if lost.
439
440   Why:    This is a fundamental robustness and disaster recovery tool
441           which will increase the comfort level of a sysadmin
442           considering adopting Bacula.
443
444   Notes:  A skeleton of this program already exists, but much work
445           needs to be done. Implementing this will also make apparent
446           any deficiencies in the current Bacula tape format.
447
448
449 Item 4:   Implement Base jobs.
450
451   What:   A base job is sort of like a Full save except that you 
452           will want the FileSet to contain only files that are unlikely
453           to change in the future (i.e. a snapshot of most of your
454           system after installing it). After the base job has been run,
455           when you are doing a Full save, you can specify to exclude
456           all files saved by the base job that have not been modified.
457
458   Why:    This is something none of the competition does, as far as we know
459           (except BackupPC, which is a Perl program that saves to disk
460           only).  It is big win for the user, it makes Bacula stand out
461           as offering a unique optimization that immediately saves time
462           and money.
463
464   Notes:  Big savings in tape usage. Will require more resources because
465           the e. DIR must send FD a list of files/attribs, and the FD must
466           search the list and compare it for each file to be saved.
467
468
469 Item 5:   Implement Label templates
470
471   What:   This is a mechanism whereby Bacula can automatically create
472           a tape label for new tapes according to a detailed specification
473           provided by the user.
474
475   Why:    It is a major convenience item for folks who use automated label
476           creation.
477
478   Notes:  Bacula already has a working form of automatic tape label
479           creation, but it is very crude. The design for the complete
480           tape labeling project is already documented in the manual.
481
482
483 Item 6:   Write a regression script.
484 Done --   Continue to expand its testing.
485
486   What:   This is an automatic script that runs and tests as many features
487           of Bacula as possible. The output is compared to previous
488           versions of Bacula and any differences are reported.
489
490   Why:    This is an enormous help in preventing introduction of new
491           errors in parts of the program that already work correctly.
492
493   Notes:  This probably should be ranked higher, it's something the typical
494           user doesn't see.  Depending on how it's implemented, it may
495           make sense to defer it until the archival tape format and
496           user interface mature.
497
498
499 Item 7:   GUI for interactive restore
500 Item 8:   GUI for interactive backup
501
502   What:   The current interactive restore is implemented with a tty
503           interface. It would be much nicer to be able to "see" the
504           list of files backed up in typical GUI tree format.
505           The same mechanism could also be used for creating 
506           ad-hoc backup FileSets (item 8).
507
508   Why:    Ease of use -- especially for the end user.
509
510   Notes:  Rather than implementing in Gtk, we probably should go directly
511           for a Browser implementation, even if doing so meant the
512           capability wouldn't be available until much later.  Not only
513           is there the question of Windows sites, most
514           Solaris/HP/IRIX, etc,  shops can't currently run Gtk programs
515           without installing lots of stuff admins are very wary about.
516           Real sysadmins will always use the command line anyway, and
517           the user who's doing an interactive restore or backup of his
518           own files will in most cases be on a Windows machine running
519           Exploder.
520
521
522 Item 9:   Add SSL to daemon communications.
523 Inprogress as of version 1.31.
524
525   What:   This provides for secure communications between the daemons.
526
527   Why:    This would allow doing backup across the Internet without
528           privacy concerns (or with much less concern).
529
530   Notes:  The vast majority of near term potential users will be backing up
531           a single site over a LAN and, correctly or not, they probably
532           won't be concerned with security, at least not enough to go to
533           the trouble to set up keys, etc. to screw things down.  We suspect
534           that many users genuinely interested in multi-site backup
535           already run some form of VPN software in their internetwork
536           connections, and are willing to delegate security to that layer.
537
538
539 Item 10:  Define definitive tape format.
540 Done (version 1.27)
541
542   What:   Define that definitive tape format that will not change 
543           for the next millennium.
544
545   Why:    Stability, security.
546
547   Notes:  See notes for item 11 below.
548
549
550 Item 11:  New daemon communication protocol.
551
552   What:   The current daemon to daemon protocol is basically an ASCII
553           printf() and sending the buffer. On the receiving end, the
554           buffer is sscanf()ed to unpack it. The new scheme would
555           be a binary format that allows quick packing and unpacking
556           of any data type with named fields.
557
558   Why:    Using binary packing would be faster. Named fields will permit
559           error checking to ensure that what is sent is what the 
560           receiver really wants.
561
562   Notes:  These are internal improvements in the interest of the
563           long-term stability and evolution of the program.  On the one
564           hand, the sooner they're done, the less code we have to rip
565           up when the time comes to install them.  On the other hand, they
566           don't bring an immediately perceptible benefit to potential
567           users.  Item 10 and possibly item 11 should be deferred until Bacula
568           is well established with a growing user community more or
569           less happy with the feature set.  At that time, it will make a
570           good "next generation" upgrade in the interest of data
571           immortality.
572
573
574
575
576 ======================================================
577         Base Jobs design
578 It is somewhat like a Full save becomes an incremental since
579 the Base job (or jobs) plus other non-base files.
580 Need:
581 - New BaseFile table that contains:
582     JobId, BaseJobId, FileId (from Base).
583   i.e. for each base file that exists but is not saved because
584   it has not changed, the File daemon sends the JobId, BaseId,
585   and FileId back to the Director who creates the DB entry.
586 - To initiate a Base save, the Director sends the FD 
587   the FileId, and full filename for each file in the Base.
588 - When the FD finds a Base file, he requests the Director to
589   send him the full File entry (stat packet plus MD5), or
590   conversely, the FD sends it to the Director and the Director
591   says yes or no. This can be quite rapid if the FileId is kept
592   by the FD for each Base Filename.          
593 - It is probably better to have the comparison done by the FD
594   despite the fact that the File entry must be sent across the
595   network.
596 - An alternative would be to send the FD the whole File entry
597   from the start. The disadvantage is that it requires a lot of
598   space. The advantage is that it requires less communications
599   during the save.
600 - The Job record must be updated to indicate that one or more
601   Bases were used.
602 - At end of Job, FD returns:   
603    1. Count of base files/bytes not written to tape (i.e. matches)
604    2. Count of base file that were saved i.e. had changed.
605 - No tape record would be written for a Base file that matches, in the
606   same way that no tape record is written for Incremental jobs where
607   the file is not saved because it is unchanged.
608 - On a restore, all the Base file records must explicitly be
609   found from the BaseFile tape. I.e. for each Full save that is marked
610   to have one or more Base Jobs, search the BaseFile for all occurrences
611   of JobId.
612 - An optimization might be to make the BaseFile have:
613      JobId
614      BaseId
615      FileId
616   plus
617      FileIndex
618   This would avoid the need to explicitly fetch each File record for
619   the Base job.  The Base Job record will be fetched to get the
620   VolSessionId and VolSessionTime.
621 =========================================================  
622
623   
624
625 =============================================================
626
627                 Request For Comments For File Backup Options
628                    10 November 2002
629
630 Subject: File Backup Options
631
632 Problem: 
633   A few days ago, a Bacula user who is backing up to file volumes and
634   using compression asked if it was possible to suppress compressing
635   all .gz files since it was a waste of CPU time. Although Bacula
636   currently permits using different options (compression, ...) on
637   a directory by directory basis, it cannot do it on a file by 
638   file basis, which is clearly what was desired.   
639
640 Proposed Implementation:
641   To solve this problem, I propose the following:
642
643   - Add a new Director resource type called FileOptions.  
644
645   - The FileOptions resource will have records for all
646     options that can currently be specified on the Include record 
647     (in a FileSet).  Examples below.
648
649   - The FileOptions resource will permit an exclude option as well
650     as a number of additional options.
651
652   - The heart of the FileOptions resource is the ability to
653     supply any number of ApplyTo records which specify POSIX
654     regular expressions.  These ApplyTo regular expressions are
655     applied to the fully qualified filename (path and all). If
656     one matches, then the FileOptions will be used.
657
658   - When an ApplyTo specification matches an included file, the
659     options specified in the FileOptions resource will override
660     the default options specified on the Include record.
661
662   - Include records will be modified to permit referencing one or
663     more FileOptions resources.  The FileOptions will be used
664     in the order listed on the Include record and the first
665     one that matches will be applied.
666
667   - Options (or specifications) currently supplied on the Include
668     record will be deprecated (i.e. removed in a later version a
669     year or so from now).
670
671   - The Exclude record will be deprecated as the same functionality
672     can be obtained by using an Exclude = yes in the FileOptions.
673
674 FileOptions records:
675   The following records can appear in the FileOptions resource. An
676   asterisk preceding the name indicates a feature not currently
677   implemented.
678
679   For Backup Jobs:
680     - Compression= (GZIP, ...)
681     - Signature=   (MD5, SHA1, ...)
682     - *Encryption=
683     - OneFs=      (yes/no)    - remain on one filesystem
684     - Recurse=    (yes/no)    - recurse into subdirectories
685     - Sparse=     (yes/no)    - do sparse file backup
686     - *Exclude=   (yes/no)    - exclude file from being saved
687     - *Reader=    (filename)  - external read (backup) program
688     - *Plugin=    (filename)  - read/write plugin module
689
690   For Verify Jobs:
691     - verify=     (ipnougsamc5) - verify options
692
693   For Restore Jobs:
694     - replace= (always/ifnewer/ifolder/never) - replace options currently
695                                                 implemented in 1.27
696     - *Writer= (filename)   - external write (restore) program
697
698
699 Implementation:
700   Currently options specifying compression, MD5 signatures, recursion,
701   ... of a FileSet are supplied on the Include record. These will now
702   all be collected into a FileOptions resource, which will be
703   specified on the Include in place of the options. Multiple FileOptions
704   may be specified.  Since the FileOptions contain regular expressions
705   that are applied to the full filename, this will give the ability
706   to specify backup options on a file by file basis to whatever level
707   of detail you wish.
708
709 Example:
710
711   Today:
712
713     FileSet {
714       Name = "FullSet"
715       Include = compression=GZIP signature=MD5 {
716         /
717       }
718     }
719
720   Proposal:
721
722     FileSet {
723       Name = "FullSet"
724       Include = FileOptions=Opts {
725         /
726       }
727     }
728     FileOptions {
729       Name = Opts
730       Compression = GZIP
731       Signature = MD5
732       ApplyTo = /*.?*/
733     }
734
735   That's a lot more to do the same thing, but it gives the ability to
736   apply options on a file by file basis.  For example, suppose you
737   want to compress all files but not any file with extensions .gz or .Z.
738   You could do so as follows:
739
740     FileSet {
741       Name = "FullSet"
742       Include = FileOptions=NoCompress FileOptions=Opts {
743         /
744       }
745     }
746     FileOptions {
747       Name = Opts
748       Compression = GZIP
749       Signature = MD5
750       ApplyTo = /*.?*/   # matches all files
751     }
752     FileOptions {
753       Name = NoCompress
754       Signature = MD5
755       # Note multiple ApplyTos are ORed
756       ApplyTo = /*.gz/   # matches .gz files */
757       ApplyTo = /*.Z/    # matches .Z files */
758     }
759
760   Now, since the NoCompress FileOptions is specified first on the
761   Include line, any *.gz or *.Z file will have an MD5 signature computed,
762   but will not be compressed. For all other files, the NoCompress will not
763   match, so the Opts options will be used which will include GZIP
764   compression.
765
766 Questions:
767   - Is it necessary to provide some means of ANDing regular expressions
768     and negation?  (not currently planned)
769
770     e.g.  ApplyTo = /*.gz/ && !/big.gz/
771
772   - I see that Networker has a "null" module which, if specified, does not 
773     backup the file, but does make an record of the file in the catalog
774     so that the catalog will reflect an exact picture of the filesystem.
775     The result is that the file can be "seen" when "browsing" the save
776     sets, but it cannot be restored.
777     
778     Is this really useful?  Should it be implemented in Bacula?
779   
780 Results:
781   After implementing the above, the user will be able to specify
782   on a file by file basis (using regular expressions) what options are
783   applied for the backup.
784
785
786 =============================================
787
788 ========================================================== 
789     Unsaved File design
790 For each Incremental job that is run, there may be files that
791 were found but not saved because they were locked (this applies
792 only to Windows). Such a system could send back to the Director
793 a list of Unsaved files.
794 Need:
795 - New UnSavedFiles table that contains:
796   JobId
797   PathId
798   FilenameId
799 - Then in the next Incremental job, the list of Unsaved Files will be
800   feed to the FD, who will ensure that they are explicitly chosen even
801   if standard date/time check would not have selected them.
802 =============================================================
803
804
805 Done: (see kernsdone for more)
806 - Heartbeat between daemons.
807 - Fix Dir heartbeat in restore and verify vol.  Be sure to make
808   bnet_recv() ignore BNET_HEARTBEAT.
809 - Implement HEART_BEAT while SD waiting for tapes.
810 - Include RunBeforeJob and RunAfterJob output in the message
811   stream.
812 - Change M_INFO to M_RESTORED for all restored files.
813 - Fix command prompt in gnome-console by checking on Ready.
814 - Merge SQLite, MySQL, and Rel spec into a single file.
815 - Fix config of "console"
816 - Check if cancel works with FD (fixed).
817 - Properly configure console and gconsole (currently for source not
818   configured for installation).
819 - Error labeling tape from console gets Jmsg error because of no Job.
820 - Test and implement get_pint and get_yesno.
821 - Implement global with DB name and add to btraceback.gdb
822 - Remove subsysdir from conf files (used only in autostart scripts).
823 - Fix the following:
824   rufus-dir: Max configured use duration exceeded. Marking Volume "MatouBackup" as Used.
825    rufus-sd: Volume "" previously written, moving to end of data.
826    rufus-sd: Matou.2003-05-10_10.39.18 Error: I canot write on this volume because:
827       The number of files mismatch! Volume=1 Catalog=0
828    rufus-sd: Matou.2003-05-10_10.39.18 Error: askdir.c:155 NULL Volume name. This shouldn't happen!!!
829 - Shell character expansion is failing occassionally.
830 - Add a section to the doc on Manual cycling of Volumes.
831 - Check if Job/File retentions apply to multivolume jobs.
832 - Fix missing casette in autoloader during read:
833   14-May-2003 14:41 undef-sd: RestoreFiles.2003-05-14_14.41.00 Warning: acquire.c:106 Volume name mismatch. Wanted TestVolume0005 got TestVolume0010
834   14-May-2003 14:41 undef-sd: 3301 Issuing autochanger "loaded" command.
835   14-May-2003 14:41 undef-sd: 3302 Issuing autochanger "unload" command.
836   14-May-2003 14:42 undef-sd: 3303 Issuing autochanger "load slot 1" command.
837   14-May-2003 14:42 undef-sd: 3304 Autochanger "load slot 1" status is OK.
838   14-May-2003 14:42 undef-sd: RestoreFiles.2003-05-14_14.41.00 Warning: acquire.c:106 Volume name mismatch. Wanted TestVolume0005 got TestVolume0009
839   14-May-2003 14:42 undef-sd: 3301 Issuing autochanger "loaded" command.
840   14-May-2003 14:42 undef-sd: RestoreFiles.2003-05-14_14.41.00 Warning: acquire.c:106 Volume name mismatch. Wanted TestVolume0005 got TestVolume0009
841   14-May-2003 14:42 undef-sd: 3301 Issuing autochanger "loaded" command.
842   14-May-2003 14:42 undef-sd: RestoreFiles.2003-05-14_14.41.00 Warning: acquire.c:106 Volume name mismatch. Wanted TestVolume0005 got TestVolume0009
843   14-May-2003 14:42 undef-sd: 3301 Issuing autochanger "loaded" command.
844   14-May-2003 14:42 undef-sd: RestoreFiles.2003-05-14_14.41.00 Warning: acquire.c:106 Volume name mismatch. Wanted TestVolume0005 got TestVolume0009
845   14-May-2003 14:42 undef-sd: 3301 Issuing autochanger "loaded" command.
846   14-May-2003 14:42 undef-sd: RestoreFiles.2003-05-14_14.41.00 Fatal error: acquire.c:129 Too many errors trying to mount device "/dev/nrsa0".
847   14-May-2003 14:42 undef-dir: Bacula 1.31 (12May03): 14-May-2003 14:42
848 - Fix problem reported by Christopher McCurdy <cmccurdy@eecis.udel.edu>
849    xeon-fd:      Could not stat c:/Documents and Settings/All 
850    Users/Application Data/Humc:\Documents and Settings\All User98_AIX.kbf: 
851    ERR=No such file or directory
852    Cannot reproduce.
853 - The following  Re-read last block at EOT failed. ERR=block.c:523 Read zero bytes on device /dev/nrsa0.
854     undef-sd: block.c:523 Read zero bytes on device /dev/nrsa0.
855   apparently masks the standard EOM message.
856 - BSD (probably) does not have strtoll()
857 - BSD does not have ioctl() MTEOM
858 - BSD defines a number of MT_xxx variables which conflict
859   with those defined by Bacula.
860 - Make default duration days if no qualifier (e.g. s) is specified.
861 - BSDI fix finding gcc version
862 - When the FD errs (e.g. disk full) have a more graceful shutdown.
863 - Make sure Bacula prunes/purges canceled and failed jobs too and all
864   jobs with zero JobFiles.
865 - Implement Volume name checking.
866 - Document what characters can go into Volume names.
867 - Getting the following on all directories on Win32
868   19-May-2003 01:14 tibs-fd:      Could not access c:/cygwin/home/kern/rxvt: ERR=Permission denied
869 - Cancellation caused JobMedia error:
870      babylon5-dir: Last FULL backup time not found. Doing FULL backup.               
871      babylon5-dir: Start Backup JobId 416, Job=Zocalo_Save.2003-05-19_02.15.06       
872      babylon5-sd: End of media on Volume VXA-V17-Inc-001 Bytes=31,982,900,672 Blocks=495,781.
873      babylon5-sd: Job Zocalo_Save.2003-05-19_02.15.06 waiting. Cannot find any appendable volumes.
874      babylon5-sd: Someone woke me up, but I cannot find any appendable volumes
875        for Job=Zocalo_Save.2003-05-19_02.15.06.                                
876      babylon5-sd: Zocalo_Save.2003-05-19_02.15.06 Fatal error: Job
877        Zocalo_Save.2003-05-19_02.15.06 canceled while waiting for mount on
878        Storage Device "Ecrix_VXA-1".
879      babylon5-sd: Zocalo_Save.2003-05-19_02.15.06 Fatal error: Cannot fixup device
880        error. Job Zocalo_Save.2003-05-19_02.15.06 canceled while waiting for
881        mount on Storage Device "Ecrix_VXA-1".
882                                                                                      
883      babylon5-dir: Zocalo_Save.2003-05-19_02.15.06 Error: Catalog error creating
884        JobMedia record. sql_create.c:125 Create JobMedia failed. Record already
885        exists.
886      babylon5-sd: Zocalo_Save.2003-05-19_02.15.06 Error: Error creating JobMedia
887        record: 1991 Update JobMedia error
888                                                                                      
889      babylon5-sd: Zocalo_Save.2003-05-19_02.15.06 Error: askdir.c:158 NULL Volume
890        name. This shouldn't happen!!!
891      zocalo-fd: Zocalo_Save.2003-05-19_02.15.06 Error: bnet.c:310 Write error
892        sending to Storage daemon:babylon5:9103: ERR=Broken pipe
893 - Volume names with spaces get jammed into the catalog with 0x1 
894   i.e. the SD bashes the Volume but they are not unbased by Dir.
895   jerom-dir: MonthlySave.2003-05-10_17.12.01 Error: Unable to get Media
896   record for Volume Tape^A1: ERR=sql_get.c:788 Media record for Volume
897   "Tape^A1" not found.
898    jerom-sd: MonthlySave.2003-05-10_17.12.01 Error: Error updating Volume
899    Info: 1991 Catalog Request failed: sql_get.c:788 Media record for Volume
900    "Tape^A1" not found.
901 - ChangeServiceConfig2A does not exist on WinNT (ADVAPI32.DLL).
902 - Fix "access not allowed" for backup of files on WinXP.
903 - Check for existence of all new Win32 API's.  See LoadLibrary in 
904   winservice.cpp
905 - Count errors during restore and print them in the Job report.
906 - Bug: fix access problems on files restored on WinXP.
907 - Put system type returned by FD into catalog.
908 - Finish WIN32_DATA stream code (bextract, check if can handle stream)
909 - Make SD keep track of Files, Bytes during restore.