]> git.sur5r.net Git - bacula/bacula/blob - bacula/kernstodo
Clean up some SD message nos.
[bacula/bacula] / bacula / kernstodo
1                  Kern's ToDo List
2                   9 April 2003 
3
4 Documentation to do: (a little bit at a time)
5 - Document running a test version.
6 - Document query file format.
7 - Document static linking
8 - Document how to automatically backup all local partitions
9 - Document problems with Verify and pruning.
10 - Document how to use multiple databases.
11 - Document Maximum File Size
12 - Add a section to the doc on Manual cycling of Volumes.
13
14 - Document logrotate
15 - Document default file backup
16           
17 Testing to do: (painful)
18 - that ALL console command line options work and are always implemented
19 - blocksize recognition code.
20 - multiple simultaneous Volumes
21
22 For 1.30 release:
23 - Fix Bare Metal restore problem.
24 - Fix "access not allowed" for backup of files on WinXP.
25
26 - Figure out how to use ssh or stunnel to protect Bacula communications.
27
28 After 1.30:
29 - Implement a M_SECURITY message class.
30 - Allow multiple Storage specifications (or multiple names on
31   a single Storage specification) in the Job record. Thus a job 
32   can be backed up to a number of storage devices.
33 - Implement dump label to UA
34 - Add prefixlinks to where or not where absolute links to FD.
35 - Look at Python for a Bacula scripting language -- www.python.org
36 - Issue message to mount a new tape before the rewind.
37 - Simplified client job initiation for portables.
38 - If SD cannot open a drive, make it periodically retry.
39 - Implement LabelTemplate (at least first cut).
40 - Add more of the config info to the tape label.
41 - Implement a Mount Command and an Unmount Command where
42   the users could specify a system command to be performed
43   to do the mount, after which Bacula could attempt to
44   read the device. This is for Removeable media such as a CDROM.
45   - Most likely, this mount command would be invoked explicitly
46   by the user using the current Console "mount" and "unmount" 
47   commands -- the Storage Daemon would do the right thing 
48   depending on the exact nature of the device.
49   - As with tape drives, when Bacula wanted a new removable
50   disk mounted, it would unmount the old one, and send a message
51   to the user, who would then use "mount" as described above 
52   once he had actually inserted the disk.
53
54 - Make some way so that if a machine is skipped because it is not up 
55   that Bacula will continue retrying for a specified period of time --
56   periodically.
57 - If tape is marked read-only, then try opening it read-only rather than
58   failing, and remember that it cannot be written.
59 - Refine SD waiting output:
60     Device is being positioned
61     >     Device is being positioned for append
62     >     Device is being positioned to file x
63     > 
64 - Figure out some way to estimate output size and to avoid splitting
65   a backup across two Volumes -- this could be useful for writing CDROMs
66   where you really prefer not to have it split -- not serious.
67 - Add RunBeforeJob and RunAfterJob to the Client program.
68 - Have SD compute MD5 or SHA1 and compare to what FD computes.
69 - Make VolumeToCatalog calculate an MD5 or SHA1 from the 
70   actual data on the Volume and compare it.                  
71 - Implement FileOptions (see end of this document)
72 - Implement Bacula plugins -- design API
73 - Make bcopy read through bad tape records.
74 - Fix read_record to handle multiple sessions.
75 - Program files (i.e. execute a program to read/write files).
76   Pass read date of last backup, size of file last time.
77 - Add Signature type to File DB record.
78 - Make Restore report an error if FD or SD term codes are not OK.
79 - CD into subdirectory when open()ing files for backup to
80   speed up things.  Test with testfind().
81 - Priority job to go to top of list.
82 - Find out why Full saves run slower and slower (hashing?)
83 - Why are save/restore of device different sizes (sparse?)   Yup! Fix it.
84 - Implement some way for the Console to dynamically create a job.
85 - Restore to a particular time -- e.g. before date, after date. 
86 - Implement disk spooling
87 - Solaris -I on tar for include list
88 - Prohibit backing up archive device (findlib/find_one.c:128)
89 - Need a verbose mode in restore, perhaps to bsr.
90 - bscan without -v is too quiet -- perhaps show jobs.
91 - Add code to reject whole blocks if not wanted on restore.
92 - Start working on Base jobs.
93 - Check if we can increase Bacula FD priorty in Win2000
94 - Make sure the MaxVolFiles is fully implemented in SD
95 - Check if both CatalogFiles and UseCatalog are set to SD.
96 - Need return status on read_cb() from read_records(). Need multiple
97   records -- one per Job, maybe a JCR or some other structure with
98   a block and a record.
99 - Figure out how to do a bare metal Windows restore
100 - Put system type returned by FD into catalog.
101 - Possibly add email to Watchdog if drive is unmounted too
102   long and a job is waiting on the drive.
103 - Use read_record.c in SD code.
104 - Why don't we get an error message from Win32 FD when bootstrap 
105   file cannot be created for restore command?
106 - When Marking a file in Restore that is a hard link, also
107   mark the link so that the data will be reloaded.
108 - Restore program that errors in SD due to no tape reports
109   OK incorrectly in output.
110 - After unmount, if restore job started, ask to mount.
111 - Convert all %x substitution variables, which are hard to remember
112   and read to %(variable-name).  Idea from TMDA.
113 - Add JobLevel in FD status (but make sure it is defined).
114 - Make Pool resource handle Counter resources.
115 - Remove NextId for SQLite. Optimize.
116 - Move all SQL statements into a single location.
117 - Add UA rc and history files.
118 - put termcap (used by console) in ./configure and
119   allow -with-termcap-dir.
120 - Enhance time and size scanning routines.
121 - Fix Autoprune for Volumes to respect need for full save.
122 - Fix Win32 config file definition name on /install
123 - No READLINE_SRC if found in alternate directory.
124 - Test a second language e.g. french.
125 - Compare tape to Client files (attributes, or attributes and data) 
126 - Make all database Ids 64 bit.
127 - Write an applet for Linux.
128 - Add estimate to Console commands
129 - Find solution to blank filename (i.e. path only) problem.
130 - Implement new daemon communications protocol.
131 - Remove PoolId from Job table, it exists in Media.
132 - Allow console commands to detach or run in background.
133 - Fix status delay on storage daemon during rewind.
134 - Add SD message variables to control operator wait time
135   - Maximum Operator Wait
136   - Minimum Message Interval
137   - Maximum Message Interval
138 - Send Operator message when cannot read tape label.
139 - Verify level=Volume (scan only), level=Data (compare of data to file).
140   Verify level=Catalog, level=InitCatalog
141 - Events file
142 - Add keyword search to show command in Console.
143 - Fix Win2000 error with no messages during startup.
144 - Events : tape has more than xxx bytes.
145 - Restrict characters permitted in a Resource name.
146 - Complete code in Bacula Resources -- this will permit
147   reading a new config file at any time.
148 - Handle ctl-c in Console
149 - Implement script driven addition of File daemon to config files.
150 - Think about how to make Bacula work better with File (non-tape) archives.
151 - Write Unix emulator for Windows.
152 - Implement new serialize subroutines
153    send(socket, "string", &Vol, "uint32", &i, NULL)
154 - Audit all UA commands to ensure that we always prompt where possible.
155 - If ./btape is called without /dev, assume argument is a Storage resource name.
156 - Put memory utilization in Status output of each daemon
157   if full status requested or if some level of debug on.
158 - Make database type selectable by .conf files i.e. at runtime
159 - Set flag for uname -a.  Add to Volume label.
160 - Implement throttled work queue.
161 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
162 - Restore files modified after date
163 - Restore file modified before date
164 - Emergency restore info:
165   - Backup Bacula
166   - Backup working directory
167   - Backup Catalog
168 - Restore -- do nothing but show what would happen
169 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
170 - Implement Restore FileSet=
171 - Create a protocol.h and protocol.c where all protocol messages
172   are concentrated.
173 - Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...).
174 - Timout a job or terminate if link goes down, or reopen link and query.
175 - Find general solution for sscanf size problems (as well
176   as sprintf. Do at run time?
177 - Concept of precious tapes (cannot be reused).
178 - Make bcopy copy with a single tape drive.
179 - Permit changing ownership during restore.
180
181 - Autolabel should be specified by DIR instead of SD.
182 - Find out how to get the system tape block limits, e.g.:
183   Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.  
184   Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
185 - Storage daemon    
186   - Add media capacity
187   - AutoScan (check checksum of tape)
188   - Format command = "format /dev/nst0"
189   - MaxRewindTime
190   - MinRewindTime
191   - MaxBufferSize
192   - Seek resolution (usually corresponds to buffer size)
193   - EODErrorCode=ENOSPC or code
194   - Partial Read error code
195   - Partial write error code
196   - Nonformatted read error
197   - Nonformatted write error
198   - WriteProtected error
199   - IOTimeout
200   - OpenRetries
201   - OpenTimeout
202   - IgnoreCloseErrors=yes
203   - Tape=yes
204   - NoRewind=yes
205 - Pool
206   - Maxwrites
207   - Recycle period
208 - Job
209   - MaxWarnings
210   - MaxErrors (job?)
211 =====
212 - FD sends unsaved file list to Director at end of job (see
213   RFC below).
214 - File daemon should build list of files skipped, and then
215   at end of save retry and report any errors.
216 - Write a Storage daemon that uses pipes and
217   standard Unix programs to write to the tape.
218   See afbackup.
219 - Need something that monitors the JCR queue and
220   times out jobs by asking the deamons where they are.
221 - Enhance Jmsg code to permit buffering and saving to disk.
222 - device driver = "xxxx" for drives.
223 - restart: paranoid: read label fsf to
224   eom read append block, and go
225   super-paranoid: read label, read all files
226   in between, read append block, and go
227   verify: backspace, read append block, and go
228   permissive: same as above but frees drive
229   if tape is not valid.
230 - Verify from Volume
231 - Ensure that /dev/null works
232 - Need report class for messages. Perhaps
233   report resource where report=group of messages
234 - enhance scan_attrib and rename scan_jobtype, and
235   fill in code for "since" option 
236 - Director needs a time after which the report status is sent
237   anyway -- or better yet, a retry time for the job.
238   Don't reschedule a job if previous incarnation is still running.
239 - Some way to automatically backup everything is needed????
240 - Need a structure for pending actions:
241   - buffered messages
242   - termination status (part of buffered msgs?)
243 - Drive management
244   Read, Write, Clean, Delete
245 - Login to Bacula; Bacula users with different permissions:
246    owner, group, user, quotas
247 - Store info on each file system type (probably in the job header on tape.
248   This could be the output of df; or perhaps some sort of /etc/mtab record.
249
250 Longer term to do:
251 - Design at hierarchial storage for Bacula. Migration and Clone. 
252 - Implement FSM (File System Modules).
253 - Identify unchanged or "system" files and save them to a
254   special tape thus removing them from the standard 
255   backup FileSet -- BASE backup.
256 - Heartbeat between daemons.
257 - Audit M_ error codes to ensure they are correct and consistent.
258 - Add variable break characters to lex analyzer.
259   Either a bit mask or a string of chars so that
260   the caller can change the break characters.
261 - Make a single T_BREAK to replace T_COMMA, etc.
262 - Ensure that File daemon and Storage daemon can
263   continue a save if the Director goes down (this
264   is NOT currently the case). Must detect socket error,
265   buffer messages for later. 
266 - Enhance time/duration input to allow multiple qualifiers e.g. 3d2h
267 - Add ability to backup to two Storage devices (two SD sessions) at
268   the same time -- e.g. onsite, offsite.
269 - Add the ability to consolidate old backup sets (basically do a restore
270   to tape and appropriately update the catalog). Compress Volume sets.
271   Might need to spool via file is only one drive is available.
272 - Compress or consolidate Volumes of old possibly deleted files. Perhaps
273   someway to do so with every volume that has less than x% valid 
274   files.
275
276   
277 Projects:
278             Bacula Projects Roadmap 
279                17 August 2002
280            last update 5 January 2003
281
282 Item 1:   Multiple simultaneous Jobs. (done)
283 Done -- Restore part needs better implementation to work correctly
284
285   What:   Permit multiple simultaneous jobs in Bacula.
286
287   Why:    An enterprise level solution needs to go fast without the
288           need for the system administrator to carefully tweak
289           timing.  Based on the benchmarks, during a full
290           backup, NetWorker typically hit 10 times the bandwidth to
291           the tape compared to Bacula--largely. This is probably due to
292           running parallel jobs and multi-threaded filling of buffers
293           and writing them to tape.  This should also make things work
294           better when you have a mix of fast and slow machines backing
295           up at the same time.
296
297   Notes:  Bacula was designed to run multiple simultaneous jobs. Thus
298           implementing this is a matter of some small cleanups and
299           careful testing.
300
301
302 Item 2:   Make the Storage daemon use intermediate file storage to buffer data.
303 Deferred -- not necessary yet.
304
305   What:   If data is coming into the SD too fast, buffer it to 
306           disk if the user has configured this option.
307
308   Why:    This would be nice, especially if it more or less falls out
309           when implementing (1) above.  If not, it probably should not
310           be given a high priority because fundamentally the backup time
311           is limited by the tape bandwidth.  Even though you may finish a
312           client job quicker by spilling to disk, you still have to
313           eventually get it onto tape.  If intermediate disk buffering
314           allows us to improve write bandwidth to tape, it may make
315           sense.
316
317   Notes:  Whether or not this is implemented will depend upon performance
318           testing after item 1 is implemented.
319
320
321 Item 3:   Write the bscan program -- also write a bcopy program.
322 Done
323
324   What:   Write a program that reads a Bacula tape and puts all the 
325           appropriate data into the catalog. This allows recovery
326           from a tape that is no longer in the database, or it allows
327           re-creation of a database if lost.
328
329   Why:    This is a fundamental robustness and disaster recovery tool
330           which will increase the comfort level of a sysadmin
331           considering adopting Bacula.
332
333   Notes:  A skeleton of this program already exists, but much work
334           needs to be done. Implementing this will also make apparent
335           any deficiencies in the current Bacula tape format.
336
337
338 Item 4:   Implement Base jobs.
339
340   What:   A base job is sort of like a Full save except that you 
341           will want the FileSet to contain only files that are unlikely
342           to change in the future (i.e. a snapshot of most of your
343           system after installing it). After the base job has been run,
344           when you are doing a Full save, you can specify to exclude
345           all files saved by the base job that have not been modified.
346
347   Why:    This is something none of the competition does, as far as we know
348           (except BackupPC, which is a Perl program that saves to disk
349           only).  It is big win for the user, it makes Bacula stand out
350           as offering a unique optimization that immediately saves time
351           and money.
352
353   Notes:  Big savings in tape usage. Will require more resources because
354           the e. DIR must send FD a list of files/attribs, and the FD must
355           search the list and compare it for each file to be saved.
356
357
358 Item 5:   Implement Label templates
359
360   What:   This is a mechanism whereby Bacula can automatically create
361           a tape label for new tapes according to a detailed specification
362           provided by the user.
363
364   Why:    It is a major convenience item for folks who use automated label
365           creation.
366
367   Notes:  Bacula already has a working form of automatic tape label
368           creation, but it is very crude. The design for the complete
369           tape labeling project is already documented in the manual.
370
371
372 Item 6:   Write a regression script.
373 Started
374
375   What:   This is an automatic script that runs and tests as many features
376           of Bacula as possible. The output is compared to previous
377           versions of Bacula and any differences are reported.
378
379   Why:    This is an enormous help in preventing introduction of new
380           errors in parts of the program that already work correctly.
381
382   Notes:  This probably should be ranked higher, it's something the typical
383           user doesn't see.  Depending on how it's implemented, it may
384           make sense to defer it until the archival tape format and
385           user interface mature.
386
387
388 Item 7:   GUI for interactive restore
389 Item 8:   GUI for interactive backup
390
391   What:   The current interactive restore is implemented with a tty
392           interface. It would be much nicer to be able to "see" the
393           list of files backed up in typical GUI tree format.
394           The same mechanism could also be used for creating 
395           ad-hoc backup FileSets (item 8).
396
397   Why:    Ease of use -- especially for the end user.
398
399   Notes:  Rather than implementing in Gtk, we probably should go directly
400           for a Browser implementation, even if doing so meant the
401           capability wouldn't be available until much later.  Not only
402           is there the question of Windows sites, most
403           Solaris/HP/IRIX, etc,  shops can't currently run Gtk programs
404           without installing lots of stuff admins are very wary about.
405           Real sysadmins will always use the command line anyway, and
406           the user who's doing an interactive restore or backup of his
407           own files will in most cases be on a Windows machine running
408           Exploder.
409
410
411 Item 9:   Add SSL to daemon communications.
412
413   What:   This provides for secure communications between the daemons.
414
415   Why:    This would allow doing backup across the Internet without
416           privacy concerns (or with much less concern).
417
418   Notes:  The vast majority of near term potential users will be backing up
419           a single site over a LAN and, correctly or not, they probably
420           won't be concerned with security, at least not enough to go to
421           the trouble to set up keys, etc. to screw things down.  We suspect
422           that many users genuinely interested in multi-site backup
423           already run some form of VPN software in their internetwork
424           connections, and are willing to delegate security to that layer.
425
426
427 Item 10:  Define definitive tape format.
428 Done (version 1.27)
429
430   What:   Define that definitive tape format that will not change 
431           for the next millennium.
432
433   Why:    Stability, security.
434
435   Notes:  See notes for item 11 below.
436
437
438 Item 11:  New daemon communication protocol.
439
440   What:   The current daemon to daemon protocol is basically an ASCII
441           printf() and sending the buffer. On the receiving end, the
442           buffer is sscanf()ed to unpack it. The new scheme would
443           be a binary format that allows quick packing and unpacking
444           of any data type with named fields.
445
446   Why:    Using binary packing would be faster. Named fields will permit
447           error checking to ensure that what is sent is what the 
448           receiver really wants.
449
450   Notes:  These are internal improvements in the interest of the
451           long-term stability and evolution of the program.  On the one
452           hand, the sooner they're done, the less code we have to rip
453           up when the time comes to install them.  On the other hand, they
454           don't bring an immediately perceptible benefit to potential
455           users.  Item 10 and possibly item 11 should be deferred until Bacula
456           is well established with a growing user community more or
457           less happy with the feature set.  At that time, it will make a
458           good "next generation" upgrade in the interest of data
459           immortality.
460
461
462
463
464 ======================================================
465         Base Jobs design
466 It is somewhat like a Full save becomes an incremental since
467 the Base job (or jobs) plus other non-base files.
468 Need:
469 - New BaseFile table that contains:
470     JobId, BaseJobId, FileId (from Base).
471   i.e. for each base file that exists but is not saved because
472   it has not changed, the File daemon sends the JobId, BaseId,
473   and FileId back to the Director who creates the DB entry.
474 - To initiate a Base save, the Director sends the FD 
475   the FileId, and full filename for each file in the Base.
476 - When the FD finds a Base file, he requests the Director to
477   send him the full File entry (stat packet plus MD5), or
478   conversely, the FD sends it to the Director and the Director
479   says yes or no. This can be quite rapid if the FileId is kept
480   by the FD for each Base Filename.          
481 - It is probably better to have the comparison done by the FD
482   despite the fact that the File entry must be sent across the
483   network.
484 - An alternative would be to send the FD the whole File entry
485   from the start. The disadvantage is that it requires a lot of
486   space. The advantage is that it requires less communications
487   during the save.
488 - The Job record must be updated to indicate that one or more
489   Bases were used.
490 - At end of Job, FD returns:   
491    1. Count of base files/bytes not written to tape (i.e. matches)
492    2. Count of base file that were saved i.e. had changed.
493 - No tape record would be written for a Base file that matches, in the
494   same way that no tape record is written for Incremental jobs where
495   the file is not saved because it is unchanged.
496 - On a restore, all the Base file records must explicitly be
497   found from the BaseFile tape. I.e. for each Full save that is marked
498   to have one or more Base Jobs, search the BaseFile for all occurrences
499   of JobId.
500 - An optimization might be to make the BaseFile have:
501      JobId
502      BaseId
503      FileId
504   plus
505      FileIndex
506   This would avoid the need to explicitly fetch each File record for
507   the Base job.  The Base Job record will be fetched to get the
508   VolSessionId and VolSessionTime.
509 =========================================================  
510
511 ========================================================== 
512     Unsaved File design
513 For each Incremental job that is run, there may be files that
514 were found but not saved because they were locked (this applies
515 only to Windows). Such a system could send back to the Director
516 a list of Unsaved files.
517 Need:
518 - New UnSavedFiles table that contains:
519   JobId
520   PathId
521   FilenameId
522 - Then in the next Incremental job, the list of Unsaved Files will be
523   feed to the FD, who will ensure that they are explicitly chosen even
524   if standard date/time check would not have selected them.
525 =============================================================
526
527   
528
529 =============================================================
530
531                 Request For Comments For File Backup Options
532                    10 November 2002
533
534 Subject: File Backup Options
535
536 Problem: 
537   A few days ago, a Bacula user who is backing up to file volumes and
538   using compression asked if it was possible to suppress compressing
539   all .gz files since it was a waste of CPU time. Although Bacula
540   currently permits using different options (compression, ...) on
541   a directory by directory basis, it cannot do it on a file by 
542   file basis, which is clearly what was desired.   
543
544 Proposed Implementation:
545   To solve this problem, I propose the following:
546
547   - Add a new Director resource type called FileOptions.  
548
549   - The FileOptions resource will have records for all
550     options that can currently be specified on the Include record 
551     (in a FileSet).  Examples below.
552
553   - The FileOptions resource will permit an exclude option as well
554     as a number of additional options.
555
556   - The heart of the FileOptions resource is the ability to
557     supply any number of ApplyTo records which specify POSIX
558     regular expressions.  These ApplyTo regular expressions are
559     applied to the fully qualified filename (path and all). If
560     one matches, then the FileOptions will be used.
561
562   - When an ApplyTo specification matches an included file, the
563     options specified in the FileOptions resource will override
564     the default options specified on the Include record.
565
566   - Include records will be modified to permit referencing one or
567     more FileOptions resources.  The FileOptions will be used
568     in the order listed on the Include record and the first
569     one that matches will be applied.
570
571   - Options (or specifications) currently supplied on the Include
572     record will be deprecated (i.e. removed in a later version a
573     year or so from now).
574
575   - The Exclude record will be deprecated as the same functionality
576     can be obtained by using an Exclude = yes in the FileOptions.
577
578 FileOptions records:
579   The following records can appear in the FileOptions resource. An
580   asterisk preceding the name indicates a feature not currently
581   implemented.
582
583   For Backup Jobs:
584     - Compression= (GZIP, ...)
585     - Signature=   (MD5, SHA1, ...)
586     - *Encryption=
587     - OneFs=      (yes/no)    - remain on one filesystem
588     - Recurse=    (yes/no)    - recurse into subdirectories
589     - Sparse=     (yes/no)    - do sparse file backup
590     - *Exclude=   (yes/no)    - exclude file from being saved
591     - *Reader=    (filename)  - external read (backup) program
592     - *Plugin=    (filename)  - read/write plugin module
593
594   For Verify Jobs:
595     - verify=     (ipnougsamc5) - verify options
596
597   For Restore Jobs:
598     - replace= (always/ifnewer/ifolder/never) - replace options currently
599                                                 implemented in 1.27
600     - *Writer= (filename)   - external write (restore) program
601
602
603 Implementation:
604   Currently options specifying compression, MD5 signatures, recursion,
605   ... of a FileSet are supplied on the Include record. These will now
606   all be collected into a FileOptions resource, which will be
607   specified on the Include in place of the options. Multiple FileOptions
608   may be specified.  Since the FileOptions contain regular expressions
609   that are applied to the full filename, this will give the ability
610   to specify backup options on a file by file basis to whatever level
611   of detail you wish.
612
613 Example:
614
615   Today:
616
617     FileSet {
618       Name = "FullSet"
619       Include = compression=GZIP signature=MD5 {
620         /
621       }
622     }
623
624   Proposal:
625
626     FileSet {
627       Name = "FullSet"
628       Include = FileOptions=Opts {
629         /
630       }
631     }
632     FileOptions {
633       Name = Opts
634       Compression = GZIP
635       Signature = MD5
636       ApplyTo = /*.?*/
637     }
638
639   That's a lot more to do the same thing, but it gives the ability to
640   apply options on a file by file basis.  For example, suppose you
641   want to compress all files but not any file with extensions .gz or .Z.
642   You could do so as follows:
643
644     FileSet {
645       Name = "FullSet"
646       Include = FileOptions=NoCompress FileOptions=Opts {
647         /
648       }
649     }
650     FileOptions {
651       Name = Opts
652       Compression = GZIP
653       Signature = MD5
654       ApplyTo = /*.?*/   # matches all files
655     }
656     FileOptions {
657       Name = NoCompress
658       Signature = MD5
659       # Note multiple ApplyTos are ORed
660       ApplyTo = /*.gz/   # matches .gz files */
661       ApplyTo = /*.Z/    # matches .Z files */
662     }
663
664   Now, since the NoCompress FileOptions is specified first on the
665   Include line, any *.gz or *.Z file will have an MD5 signature computed,
666   but will not be compressed. For all other files, the NoCompress will not
667   match, so the Opts options will be used which will include GZIP
668   compression.
669
670 Questions:
671   - Is it necessary to provide some means of ANDing regular expressions
672     and negation?  (not currently planned)
673
674     e.g.  ApplyTo = /*.gz/ && !/big.gz/
675
676   - I see that Networker has a "null" module which, if specified, does not 
677     backup the file, but does make an record of the file in the catalog
678     so that the catalog will reflect an exact picture of the filesystem.
679     The result is that the file can be "seen" when "browsing" the save
680     sets, but it cannot be restored.
681     
682     Is this really useful?  Should it be implemented in Bacula?
683   
684 Results:
685   After implementing the above, the user will be able to specify
686   on a file by file basis (using regular expressions) what options are
687   applied for the backup.
688 ====================================
689
690 =========================================
691 Proposal by Bill Sellers
692
693 Return-Path: <w.a.sellers@larc.nasa.gov>
694 Received: from post.larc.nasa.gov (post.larc.nasa.gov [128.155.4.45]) by matou.sibbald.com (8.11.6/8.11.6) with ESMTP id h0ELUIm07622 for <kern@sibbald.com>; Tue, 14 Jan 2003 22:30:18 +0100
695 Received: from Baron.larc.nasa.gov (baron.larc.nasa.gov [128.155.40.132]) by post.larc.nasa.gov (pohub4.6) with ESMTP id QAA09768 for <kern@sibbald.com>; Tue, 14 Jan 2003 16:30:14 -0500 (EST)
696 Message-Id: <5.1.0.14.2.20030114153452.028dbae8@pop.larc.nasa.gov>
697 X-Sender: w.a.sellers@pop.larc.nasa.gov
698 X-Mailer: QUALCOMM Windows Eudora Version 5.1
699 Date: Tue, 14 Jan 2003 16:30:18 -0500
700 To: Kern Sibbald <kern@sibbald.com>
701 From: Bill Sellers <w.a.sellers@larc.nasa.gov>
702 Subject: Re: [Bacula-users] Bacula remote storage?
703 In-Reply-To: <1042565382.1845.177.camel@rufus>
704 References: <5.1.0.14.2.20030114113004.0293a210@pop.larc.nasa.gov> <5.1.0.14.2.20030113170650.028dad88@pop.larc.nasa.gov> <5.1.0.14.2.20030113170650.028dad88@pop.larc.nasa.gov> <5.1.0.14.2.20030114113004.0293a210@pop.larc.nasa.gov>
705 Mime-Version: 1.0
706 Content-Type: text/plain; charset="us-ascii"; format=flowed
707 X-Annoyance-Filter-Junk-Probability: 0
708 X-Annoyance-Filter-Classification: Mail
709 At 06:29 PM 1/14/2003 +0100, you wrote:
710 >Hello Bill,
711 >
712 >Well, if you cannot put a Bacula client on the machine,
713 >then it is a big problem.  If you know of some software
714 >that can do what you want, let me know, because I
715 >really just don't know how to do it -- at least not
716 >directly.
717
718
719 Hi Kern,
720
721 We have been able to get Amanda to use the HSM as a storage 
722 device.  Someone here wrote a driver for Amanda.  BUT, Amanda doesn't 
723 handle Windows systems very well (or at all without Samba).  So I am 
724 looking for a backup system that has a Windows client.  I really like the 
725 Windows integration of Bacula.
726
727 From the command line, its rather trivial to move the data around.  We use 
728 something like-
729
730 tar cf - ./files | gzip -c | rsh hsm dd of=path/file.tgz
731
732 or if you use GNU tar:
733
734 tar czf hsm:path/file.tgz ./files
735
736 One idea for you to consider; Sendmail offers pipes in the aliases file; 
737 (mailpipe:  "|/usr/bin/vacation root")  and Perl supports pipes in the 
738 "open" statement (open FILE, "|/bin/nroff -man";)  Could you could make a 
739 pipe available, as a storage device? Then we could use any command that 
740 handles stdin as a  storage destination.
741
742 Something like-
743
744 Storage {
745         Name = HSM-RSH
746         Address = hsm
747         #Password is not used in rsh, but might be used in ftp.
748         Device = "| gzip -c | rsh hsm dd of=path/file.tgz"
749         MediaType = Pipe
750 }
751
752 Storage {
753         Name = HSM-FTP
754         Address = hsm
755         Password = "foobar&-"
756         Device = "| ncftpput -c hsm /path/file.bacula"
757         MediaType = Pipe
758 }
759
760 >If you have some local storage available, you could
761 >use Bacula to backup to disk volumes, then use some
762 >other software (ftp, scp) to move them to the HSM
763 >machine. However, this is a bit kludgy.
764
765
766 It is, but maybe worth a try.  Is there some function in Bacula to put 
767 variables in filenames?  i.e. backup.2003-01-15.root
768
769 Thanks!
770 Bill
771
772 ---
773 Bill Sellers
774 w.a.sellers@larc.nasa.gov
775
776 ==============================================
777    The Project for the above
778
779 I finally realized that this is not at all
780 the same as reader/writer programs or plugins,
781 which are alternate ways of accessing the 
782 files to be backed up. Rather, it is an alternate
783 form of storage device, and I have always planned
784 that Bacula should be able to handle all sorts
785 of storage devices.
786
787 So, I propose the following phases:
788
789 1. OK from you to invest some time in testing
790    this as I implement it (requires that you
791    know how to download from the SourceForge
792    cvs -- which I imagine is a piece of cake
793    for you).
794
795 2. Dumb implementation by allowing a device to
796    be a fifo for write only.
797    Reason: easy to implement, proof of concept.
798
799 3. Try reading from fifo but with fixed block
800    sizes.
801    Reason: proof of concept, easy to implement.
802
803 4. Extend reading from fifo (restores) to handle
804    variable blocks.
805    Reason: requires some delicate low level coding
806    which could destabilize all of Bacula.
807
808 5. Implementation of above but to a program. E.g.
809     Device = "|program"  (not full pipeline).
810    Reason: routines already exist, and program can
811    be a shell script which contains anything.
812
813 6. Add full pipeline as a possibility. E.g.
814     Device = "| gzip -c | rsh hsm dd of=path/file.tgz"
815    Reason: needs additional coding to implement full
816    pipeline (must fire off either a shell or all
817    programs and connect their pipes).
818
819 There are a good number of details in each step
820 that I have left out, but I will specify them at
821 every stage, and there may be a few changes as things
822 evolve. I expect that to get to stage 5 will take a
823 few weeks, and at that point, you will have 
824 everything you need (just inside a script).
825 Stage 6 will probably take longer, but if this
826 project pleases you, what we do for 5 should 
827 be adequate for some time.
828
829
830
831 =============================================
832
833 Done: (see kernsdone for more)
834 - Look into Pruning/purging problems or why there seem to
835   be so many files listed each night.
836 - Fix cancel in find_one -- need jcr.
837 - Cancel does not work for restore in FD.
838 - Write SetJobStatus() function so cancel status not lost.
839 - Add include list to end of chain in findlib
840 - Zap sd_auth_key after use
841 - Add Bar code reading capabilities (new mtx-changer)
842 - Figure out some way to automatically backup all local partitions
843 - Make hash table for linked files in findlib/find_one.c:161
844   (not necessary)
845 - Rewrite find_one.c to use only pool_memory instead of 
846   alloca and malloc (probably not necessary).
847 - Make sure btraceback goes into /sbin not sysconf directory.
848 - InitVerify is getting pruned and it shouldn't (document it)
849 - Make 1.28c release ??? NO do 1.29 directly
850 - Set timeout on opening fifo for save or restore (findlib)
851 - Document FIFO storage device.
852 - Document fifo and | and <
853 ====== 1.30 =======
854 - Implement SHA1
855 - Get correct error status from run_program or open_bpipe().    
856 - Restrict permissions on File Volumes (now 0640).                   
857 - Umasked 022 daemons
858 - Fix restore of hard linked file.
859 - Figure out how to allow multiple simultaneous file Volumes on a single device.
860 - Implement multiple simultaneous file Volumes on a single device.
861 - Cleanup db_update_media and db_update_pool
862 - Flush all the daemon messages at the end of every job.
863 - Change stat1= fgets()!=NULL to stat1=fgest()==NULL; in 
864   run_program -- bpipe.c
865 - Apparently cancel does not work for jobs waiting to be
866   scheduled.
867 - Implement TCP/IP connection for MySQL
868 - Pull a canceled job from the Scheduling queue.
869 - Implement max_file_size in block.c (already done, just tweaked).
870 - Look at purge jobs volume (at least document it, and see if it is
871   logical).
872 - Add list volumes does all pools. list volumes pool=xxx now works.
873 - Add pool= to "list media" in ua_output.c
874 - Strip trailing slashes from Include directory names in the FD.
875 - Fix Error: bnet.c:408 gethostbyname() for lpmatou failed: 
876      ERR=Operation not permited loop.
877 - Add code if there is no mtio.h (cannot do -- too many ioctl defines needed)
878 - Produce better error messages in when error/eof writing block.
879 - Cancelling of a queued job does NOT work!!!!!!
880 - Get two 
881 rufus-dir: Volume used once. Marking Volume "File0003" as Used.
882 rufus-sd: Recycled volume File0003 on device /home/kern/bacula/working, all previous data lost.
883 rufus-dir: Volume used once. Marking Volume "File0003" as Used.
884 - Ability to backup to a file then later transfer to a tape -- Migration.
885   Migration based on MaxJobs(MinJobs),MaxVols(MinVols),AgeJobs,MaxBytes(MinBytes)
886   (i.e. HighwaterMark, LowwaterMark).
887 - Eugeny Fisher <efischer@vip-rus.com> wants to cycle through a
888   set of volumes recycling the oldest volume when it is needed.
889 - gethostbyname failure in bnet_connect() continues
890   generating errors -- should stop.
891 - Add chflags() code for FreeBSD file flags
892 - Bevan Anderson suggests having a run queue for each device
893   so that multiple simultaneous jobs can run but each writing
894   to a different Volume.
895 - Look at handling <> in smtp doesn't work with exim.
896 - Need to specify MaximumConcurrentJobs in the Job resource.
897 - ***test GetFileAttributexEx, and remove MessageBox at 335 of winservice.cpp ****
898 - Implement finer multiprocessing options.
899 - Implement | and < in Exclude statements.
900 - Figure out some way to specify a retention period for files
901   that no longer exist on the machine -- so that we maintain
902   say backups for 30 days, but if the file is deleted, we maintain
903   the last copy for 1 year.  -- answer Volume retention.
904 - Make non-zero status from RunJobBefore/After error the job.
905 - Need define of int_least16_t in sha1.h for SuSE.
906 - Implement bar code reader for autochangers
907 - Document new MaximumConcurrentJob records (Job, Client, Storage) 
908 - Write up how to use/manage disk Volume Storage. ******
909 - Remove kern and kelvin from mysql_grant...
910 - Install grant_mysql...
911 - Strip trailing / from Include
912 - add #define ENABLE_NLS for Gnome compile on SuSE.
913 - Add Client FS/OS id (Linux, Win95/98, ...).
914 - Concept of VolumeSet during restore which is a list
915   of Volume names needed.
916 - Turn virutally all sprintfs into snprintfs.
917 - Update volume=Test01 requests pool, then lists volumes.
918   **** Test select_pool_and_media ...
919 - Document relabel
920 - Add IP address to authentication failures. 
921 - Add a default File storage so that new users can do backup
922   and restores right away.
923