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