]> git.sur5r.net Git - bacula/bacula/blob - bacula/kernstodo
Documentation + more work on restore -- kes12Aug02
[bacula/bacula] / bacula / kernstodo
1                  Kern's ToDo List
2                   11 August 2002
3
4 Irix conversion notes:
5 - no uuencode
6 - no hostname
7 To do:    
8 - Document passwords.
9 - Document running multiple Jobs
10 - Document that two Verifys at same time on same client do not work.
11 - Document how to recycle a tape in 7 days even if the backup takes a long time.
12 - Document default config file locations.
13 - Document better includes (does it cross file systems ?).
14 - Document specifically how to add new File daemon to config files.
15 - Document forcing a new tape to be used.
16 - Document "Error in message.c:500 Mail program terminated in error.
17
18 From Chuck:
19 --bindir is wrong and does not reflect prefix= in the *_sqlite_* scripts
20   (src/cats)
21 --top level configure options are not passed to the depkgs, particularly
22   prefix=
23 --Also, it might be better to split the depkgs location from the --with-sqlite
24   location. 
25 --should be able to specify e.g. --with-sqlite=/opt/local and have it find
26   lib, bin, sbin for itself
27   I tried this and it didn't find sqlite.h
28 --sd.conf password does not match dir.conf storage password
29 =======
30
31 - Fix catalog filename truncation in sql_get and elsewhere. Use
32   only a single filename split routine.
33 - Add command to reset VolFiles to a larger value (don't allow
34   a smaller number or print big warning).
35 - Make SD disallow writing on Volume with fewer files than in
36   the catalog.
37 - Make Restore report an error if FD or SD term codes are not OK.
38 - Convert all %x substitution variables, which are hard to remember
39   and read to %(variable-name)s.  Idea from TMDA.
40 - Report volume write rate.
41 - Fix db_get_job_volume_names() to return array of strings.
42 - Report compression % and other compression statistics if turned on.
43 - Add JobLevel in FD status (but make sure it is defined).
44 - Eliminate MySQL shared libraries from smtp and daemons not
45   using MySQL.
46 - Pass "Catalog Files = no" to storage daemon to eliminate
47   network traffic.
48 - Make Pool resource handle Counter resources.
49 - Remove NextId for SQLite. Optimize.
50 - Fix gethostbyname() to use gethostbyname_r()
51 - Cleanup path/filename separation in sql_get.c and sql_create.c
52 - Implement ./configure --with-client-only
53 - Strip trailing / from Include
54 - Move all SQL statements into a single location.
55 - Cleanup db_update_media and db_update_pool
56 - Add UA rc and history files.
57 - put termcap (used by console) in ./configure and
58   allow -with-termcap-dir.
59 - Remove JobMediaId it is not used.
60 - Enhance time and size scanning routines.
61 - Fix Autoprune for Volumes to respect need for full save.
62 - DateWritten may be wrong.
63 - Fix Win32 config file definition name on /install
64 - When we are at EOM, we must ask each job to write JobMedia
65   record (update_volume_info).
66 - No READLINE_SRC if found in alternate directory.
67 - Add Client FS/OS id (Linux, Win95/98, ...).
68 - Put Windows files in Windows stream?
69
70 ====== 31 May 2002 ========
71 Now that Bacula 1.20 is released, virtually all the 
72 basic features are implemented (some are still quite
73 primitive though). Over the next month or two, I'm 
74 planning to focus on the following items:
75
76 Minor details:
77 - Fix any bugs I find or you report.
78 - Finish the implementation of automatic pruning 
79   (add pruning of Restore and Verify jobs). 
80 - Make sure pruning of Volumes won't prune the
81   only backup of a FileSet
82
83 Major Project:
84 - Improve the Restore capabilities of Bacula
85   - Restore to most recent system state (i.e.
86     figure out what tapes need to be mounted and
87     in what order).
88   - Restore to a particular time (perhaps several
89     variations -- e.g. before date, after date).
90   - Interactive Restore where you get to select 
91     what files are to be restored (much like the Unix
92     "restore" program permits). Now that we have a
93     catalog of all files saved, it would be nice to
94     be able to use it. 
95   - Restore options (overwrite, overwrite if older,
96     overwrite if newer, never overwrite, ...)
97   - Improve the standalone programs (bls and bextract)
98     to have pattern matching capabilities (e.g. restore
99     by FileSet, Job, JobType, JobLevel, ...). 
100   - Ideally after each Job, Bacula could write out a 
101     set of commands to a file that if later feed to
102     bextract would restore your system to the current
103     state (at least for the saved FileSet).  This would 
104     provide a simple disaster recovery that could be 
105     initiated from a "floppy" and one simple ASCII control 
106     file. I'm not exactly sure how to do this, but it
107     shouldn't be too hard and I'll 
108     be trying to go in this direction.
109   
110 Smaller Projects:
111 - Implement tape verification to ensure that the data
112   written for a particular Job can really be read.
113 - Compare tape File attributes to Catalog.
114   (File attributes are size, dates, MD5, but not
115    data).
116 - Compare tape to Client files (attributes, or
117   attributes and data) 
118
119 Playing around:
120 - With the current Bacula 1.21 (not yet in the CVS) I
121   expect there is about 95% chance that running multiple
122   simultaneous Jobs will actually work without stepping
123   on each other. I'm planning to try this sometime soon.
124 ===========
125
126 Projects:
127 - Add Base job.
128 - Rework Storage daemon with new rwl_lock routines.
129 - Implement Label templates
130 - Pass JCR to database routines permitting better error printing.
131 - Improve Restore
132 - Verify tape data
133 - Verify against Full.
134
135 Dump:
136   mysqldump -f  --opt bacula >bacula
137
138
139 To be done:
140 - Probably add End of Data tape records (this would make
141   the tape format incompatible with the previous version).
142 - I'll most likely enhance the current tape format
143   in the way that I previously described, which will make
144   some of the labels incompatible, but the change will
145   not affect the current restore code since it does not
146   look at the details of the labels.
147 - I may add a few more waiting conditions in the Storage
148   daemon where it will current immediately aborts a
149   Job if the necessary resources are not available (e.g.
150   tape is being written and a read request arrives).
151 - Write an applet for Linux.
152
153 - Remove PoolId from Job table, it exists in Media.
154 - Allow commands to detach or run in background.
155 - Write better dump of Messages resource.
156 - Fix status delay on storage daemon during rewind.
157 - Add VerNo to each Session label record. 
158 - Add Job to Session records.
159 - Add VOLUME_CAT_INFO to the EOS tape record (as
160   well as to the EOD record).
161 - Add SD message variables to control operator wait time
162   - Maximum Operator Wait
163   - Minimum Message Interval
164   - Maximum Message Interval
165 - Add EOM handling variables
166   - Write EOD records
167   - Require EOD records
168 - Send Operator message when cannot read tape label.
169 - Think about how to handle I/O error on MTEOM.
170 - If Storage daemon aborts a job, ensure that this
171   is printed in the error message.
172 - Verify level=Volume (scan only), level=Data (compare of data to file).
173   Verify level=Catalog, level=InitCatalog
174 - Scan tape contents into database.
175 - Dump of Catalog
176 - Cold start full restore (restore catalog then
177   user selects what to restore).  Write summary file containing only
178   Job, Media, and Catalog information. Store on another machine.
179 - Dump/Restore database
180 - File system type
181 - Events file
182 - Implement first cut of Catalog Retention period (remove old
183   entries from database).
184 - Add SessionTime/Id filters to bextract.
185 - Write bscan
186 - Ensure that Start/End File/Block are correct.
187 - Add keyword search to show command in Console.
188 - If MySQL database is not running, job terminates with
189   wierd type and wierd error code.
190 - Write a regression script
191 - Report bad status from smtp or mail program.
192 - Fix Win2000 error with no messages during startup.
193 - Add estimate to Console
194 - Events : tape has more than xxx bytes.
195 - In Storage daemon, status should include job cancelled.
196 - Write general list maintenance subroutines.
197 - Implement immortal format with EDOs. 
198 - Restrict characters permitted in a Resource name.
199 - Restore file xx or files xx, yy to their most recent values.
200 - Provide definitive identification of  type in backup.
201 - Complete  code in Bacula Resources -- this will permit
202   reading a new config file at any time.
203 - Document new Console
204 - Handle ctl-c in Console
205 - Test restore of Windows backup
206 - Implement LabelTemplate (at least first cut).
207 - Implement script driven addition of File daemon to
208   config files.
209
210 - Bug: anonymous Volumes requires mount in some cases.
211 - see setgroup and user for Bacula p4-5 of stunnel.c
212 - Implement new serialize subroutines
213    send(socket, "string", &Vol, "uint32", &i, NULL)
214 - Add save type to Session label.
215 - Correct date on Session label.
216 - On I/O error, write EOF, then try to write again.
217 - Audit all UA commands to ensure that we always prompt where
218   possible.
219 - If ./btape is called without /dev, assume argument is
220   a Storage resource name.
221 - Put memory utilization in Status output of each daemon
222   if full status requested or if some level of debug on.
223 - Make database type selectable by .conf files i.e. at runtime
224 - gethostbyname failure in bnet_connect() continues
225   generating errors -- should stop.
226 - Don't create a volume that is already written. I.e. create only once.
227 - If error at end of tape, implement some way to kill waiting processes.
228 - Get correct block/file information in Catalog, pay attention
229   to change of media.
230 - Add HOST to Volume label.
231 - Set flag for uname -a.  Add to Volume label.
232 - Implement throttled work queue.
233 - Write bscan program that will syncronize the DB Media record with
234   the contents of the Volume -- for use after a crash.
235 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
236 - Allow multiple Storage specifications (or multiple names on
237   a single Storage specification) in the Job record. Thus a job 
238   can be backed up to a number of storage devices.
239 - Implement full MediaLabel code.
240 - Implement dump label to UA
241 - Copy volume using single drive.
242 - Copy volume with multiple driven (same or different block size).     
243 - Add block size (min, max) to Vol label.
244 - Concept of VolumeSet during restore which is a list
245   of Volume names needed.
246 - Restore files modified after date
247 - Restore file modified before date
248 - Emergency restore info:
249   - Backup Bacula
250   - Backup working directory
251   - Backup Catalog
252 - Restore options (do not overwrite)
253 - Restore -- do nothing but show what would happend
254 - Authentication between SD and FD
255 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
256 - Send Volumes needed during restore to Console
257 - Put Job statistics in End Session Label (files saved,
258   total bytes, start time, ...).     
259 - Put FileSet name in the SOS label.
260 - Implement Restore FileSet=
261 - Write a scanner for the UA (keyword, scan-routine, result, prompt).
262 - Create a protocol.h and protocol.c where all protocol messages
263   are concentrated.
264 - If SD cannot open a drive, make it periodically retry.
265 - Put Bacula version somewhere in Job stream, probably Start Session
266   Labels.
267 - Remove duplicate fields from jcr (e.g. jcr.level and
268   jcr.jr.Level, ...).
269 - Timout a job or terminate if link goes down, or reopen link and query.
270 - Define how we handle times to avoid problem with Unix dates (2049 ?).
271 - The daemons should know when one is already
272   running and refuse to run a second copy.
273 - Fill all fields in Vol/Job Header -- ensure that everything
274   needed is written to tape. Think about restore to Catalog
275   from tape.  Client record needs improving.
276 - Find general solution for sscanf size problems (as well
277   as sprintf. Do at run time?
278
279 - Concept of precious tapes (cannot be reused).
280 - Allow FD to run from inetd ???
281 - Preprocessing command per file.
282 - Postprocessing command per file (when restoring).
283
284 - Restore should get Device and Pool information from
285   job record rather than from config.
286 - Make SD send attribute stream to DR but first
287   buffering to file, then sending only when the
288   files are written to tape.
289 - Autolabel should be specified by DR instead of SD.
290 - Ability to recreate the catalog from a tape.
291 - Find out how to get the system tape block limits, e.g.:
292   Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.  
293   Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
294 - Storage daemon    
295   - Add media capacity
296   - AutoScan (check checksum of tape)
297   - Format command = "format /dev/nst0"
298   - MaxRewindTime
299   - MinRewindTime
300   - MaxBufferSize
301   - Seek resolution (usually corresponds to buffer size)
302   - EODErrorCode=ENOSPC or code
303   - Partial Read error code
304   - Partial write error code
305   - Nonformatted read error
306   - Nonformatted write error
307   - WriteProtected error
308   - IOTimeout
309   - OpenRetries
310   - OpenTimeout
311   - IgnoreCloseErrors=yes
312   - Tape=yes
313   - NoRewind=yes
314 - Pool
315   - Maxwrites
316   - Recycle period
317 - Job
318   - MaxWarnings
319   - MaxErrors (job?)
320 =====
321 - Eliminate duplicate File records to shrink database.
322 - FD sends unsaved file list to Director at end of job. 
323 - Implement InsertUniqueDB. 
324 - Write a Storage daemon that uses pipes and
325   standard Unix programs to write to the tape.
326   See afbackup.
327 - Need something that monitors the JCR queue and
328   times out jobs by asking the deamons where they are.
329 - Add daemon JCR JobId=0 to have a daemon context
330 - Pool resource
331   - Auto label
332   - Auto media verify
333   - Client (list of clients to force client)
334   - Devices (list of devices to force device)
335   - enable/disable
336   - Groups
337   - Levels
338   - Type: Backup, ...
339   - Recycle from other pools: Yes, No
340   - Recycle to other pools: Yes, no
341   - FileSets
342   - MaxBytes?
343   - Optional MediaType to force media?
344   - Maintain Catalog
345   - Label Template
346   - Retention Period
347   ============
348   - Name
349   - NumVols
350   - NaxVols
351   - CurrentVol
352
353 =====
354   if(connect(sockfd, (struct sockaddr * ) (& addr), sizeof(addr)) .lt. 0){
355     close(sockfd);
356     return(-6);
357   }
358
359   linger.l_onoff = 1;
360   linger.l_linger = 60;
361   i = setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char *) &linger,
362                                                 sizeof (linger));
363
364   fl = fcntl(sockfd, F_GETFL);
365   fcntl(sockfd, F_SETFL, fl & (~ O_NONBLOCK) & (~ O_NDELAY));
366 ====
367 - Add "0nnn" in front of all sscanf %s fields
368   to prevent field overflow.
369 - Restore:
370   What: jobid or file list
371   From: tape, file, ...
372   Where: original location, another path
373   How: Always replace, Replace if newer, Never replace
374   Report: files restored; files not restored; errors; warnings
375           summary.
376 - Enhance Jmsg code to permit buffering and saving to disk.
377 - Probably create a jcr with JobId=0 as a master
378   catchall if jcr not found or if operation involves
379   global operation.
380 - device driver = "xxxx" for drives.
381 - restart: paranoid: read label fsf to
382   eom read append block, and go
383   super-paranoid: read label, read all files
384   in between, read append block, and go
385   verify: backspace, read append block, and go
386   permissive: same as above but frees drive
387   if tape is not valid.
388 - Verify from Volume
389 - Ensure that /dev/null works
390 - File daemon should build list of files skipped, and then
391   at end of save retry and report any errors.
392 - Need report class for messages. Perhaps
393   report resource where report=group of messages
394 - Extract what=(session_id|file_list); where
395 - Verify from Tape
396 - enhance scan_attrib and rename scan_jobtype, and
397   fill in code for "since" option 
398 - dir_config: get rid of all printfs
399 - To buffer messages, we need associated jobid and Director name.
400 - Need to save contents of FileSet to tape?
401 - Director needs a time after which the report status is sent
402   anyway -- or better yet, a retry time for the job.
403   Don't reschedule a job if previous incarnation is still running.
404 - Figure out how to do a "full" restore from catalog
405 - Figure out how to save the catalog (possibly a special FileSet).
406 - Figure out how to restore the catalog.
407 - Figure out how to put a Volume into the catalog (from the tape)
408 - Figure out how to do a restore from a Volume
409 - Some way to automatically backup everything is needed????
410 - Need a structure for pending actions:
411   - buffered messages
412   - termination status (part of buffered msgs?)
413 - Concept of grouping Storage devices and job can use
414   any of a number of devices
415 - Drive management
416   Read, Write, Clean, Delete
417 - Login to Bacula; Bacula users with different permissions:
418    owner, group, user
419 - Tape recycle destination
420 - Job Schedule Status
421   - Automatic
422   - Manual
423   - Running
424 - File daemon should pass Director the operating system info
425   to be stored in the Client Record (or verified that it has
426   not changed).
427 - Store info on each file system type (probably in the job header on tape.
428   This could be the output of df; or perhaps some sort of /etc/mtab record.
429
430 Longer term to do:
431 - Use media 1 time (so that we can do 6 days of incremental
432   backups before switching to another tape) (already)
433   specify # times (jobs)
434   specify bytes (already)
435   specify time (seconds, hours, days)
436 - Implement FSM (File System Modules).
437 - Identify unchanged or "system" files and save them to a
438   special tape thus removing them from the standard 
439   backup FileSet -- BASE backup.
440 - Turn virutally all sprintfs into snprintfs.
441 - Heartbeat between daemons.
442 - Audit M_ error codes to ensure they are correct and
443   consistent.
444 - Add variable break characters to lex analyzer.
445   Either a bit mask or a string of chars so that
446   the caller can change the break characters.
447 - Make a single T_BREAK to replace T_COMMA, etc.
448 - Ensure that File daemon and Storage daemon can
449   continue a save if the Director goes down (this
450   is NOT currently the case). Must detect socket error,
451   buffer messages for later. 
452
453
454 Done: (see kernsdone for more)
455 --the console script is broken as installed and has to be hand-massaged with
456   paths, config files etc.
457 - Termination status in FD for Verify = C -- incorrect.
458 - Implement alter_sqlite_tables
459 - Fix scheduler -- see "Hourly cycle". It doesn't do both each
460   hour, rather it alternates between 0:05 and 0:35.
461 - Create Counter DB records.