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