From: Kern Sibbald Date: Tue, 26 Apr 2005 21:24:15 +0000 (+0000) Subject: Make option 2 of restore work better (list last 20 X-Git-Tag: Release-7.0.0~8861 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=abd6ee7846dd91f0bb20acab19d910f61815e190;p=bacula%2Fbacula Make option 2 of restore work better (list last 20 locations for a file). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1964 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index b16c3f199b..b3f0b3b2f9 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -4,7 +4,6 @@ Major development: Project Developer ======= ========= -IPv6_2 Meno Abels TLS Landon Fuller Unicode in Win32 Thorsten Engle VSS Thorsten Engle (under consideration) @@ -34,6 +33,24 @@ Autochangers: Document: - Pruning with Admin job. +- Add better documentation on how restores can be done +- OS linux 2.4 + 1) ADIC, DLT, FastStor 4000, 7*20GB + 2) Sun, DDS, (Suns name unknown - Archive Python DDS drive), 1.2GB + 3) Wangtek, QIC, 6525ES, 525MB (fixed block size 1k, block size etc. + driver dependent - aic7xxx works, ncr53c8xx with problems) + 4) HP, DDS-2, C1553A, 6*4GB +- Doc the following + to activate, check or disable the hardware compression feature on my + exb-8900 i use the exabyte "MammothTool" you can get it here: + http://www.exabyte.com/support/online/downloads/index.cfm + There is a solaris version of this tool. With option -C 0 or 1 you can + disable or activate compression. Start this tool without any options for + a small reference. +- Linux Sony LIB-D81, AIT-3 library works. +- Document PostgreSQL performance problems bug 131. +- Document testing +- Document that ChangerDevice is used for Alert command. For 1.37: - Python: @@ -47,8 +64,6 @@ For 1.37: - Make sure that Python has access to Client address/port so that it can check if Clients are alive. -- If drive is opened read/write, close it and re-open - read-only if doing a restore, and vice-versa. - Implement "NewVolumeEachJob = yes|no" in Dir. - Implement Maximum Job Spool Size - Remove all old Device resource code in Dir and code to pass it @@ -58,16 +73,10 @@ For 1.37: - Check locking of resources -- be sure to lock devices where previously resources were locked. - Add global lock on all devices when creating a device structure. -- Fix FD JobType to be set before RunBeforeJob in FD. -Ideas: -- Use non-blocking network I/O but if no data is available, use - select(). -- Use gather write() for network I/O. -- Autorestart on crash. - Maybe in 1.37: +- Fix FD JobType to be set before RunBeforeJob in FD. - Look at adding full Volume and Pool information to a Volume label so that bscan can get *all* the info. - If the user puts "Purge Oldest Volume = yes" or "Recycle Oldest Volume = yes" @@ -81,40 +90,13 @@ Maybe in 1.37: - By the way: on page http://www.bacula.org/?page=tapedrives , at the bottom, the link to "Tape Testing Chapter" is broken. It goes to /html-manual/... while the others point to /rel-manual/... -- OS linux 2.4 - 1) ADIC, DLT, FastStor 4000, 7*20GB - 2) Sun, DDS, (Suns name unknown - Archive Python DDS drive), 1.2GB - 3) Wangtek, QIC, 6525ES, 525MB (fixed block size 1k, block size etc. - driver dependent - aic7xxx works, ncr53c8xx with problems) - 4) HP, DDS-2, C1553A, 6*4GB -- Doc the following - to activate, check or disable the hardware compression feature on my - exb-8900 i use the exabyte "MammothTool" you can get it here: - http://www.exabyte.com/support/online/downloads/index.cfm - There is a solaris version of this tool. With option -C 0 or 1 you can - disable or activate compression. Start this tool without any options for - a small reference. -- Linux Sony LIB-D81, AIT-3 library works. - Device resource needs the "name" of the SD. - Add and option to see if the file size changed during backup. -- Windows restore: - data-fd: RestoreFiles.2004-12-07_15.56.42 Error: - > ..\findlib\../../findlib/create_file.c:275 Could not open e:/: ERR=Der - > Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen - > Prozess verwendet wird. - Restore restores all files, but then fails at the end trying - to set the attributes of e: -- Add better documentation on how restores can be done - from failed jobs. -- Resolve the problem between Device name and Archive name, - and fix SD messages. - Make sure SD deletes spool files on error exit. - Delete old spool files when SD starts. -- Add a restore directory-x - When labeling tapes, if you enter 000026, Bacula uses the tape index rather than the Volume name 000026. - Max Vols limit in Pool off by one? -- Tell the "restore" user when browsing is no longer possible. - Require restore via the restore command or make a restore Job get the bootstrap file. - Make bootstrap file handle multiple MediaTypes (SD) @@ -136,7 +118,6 @@ Maybe in 1.37: dev.c:1207 ioctl MTWEOF error on /dev/nst0. ERR=Permission denied. askdir.c:219 NULL Volume name. This shouldn't happen!!! 3912 Failed to label Volume: ERR=dev.c:1207 ioctl MTWEOF error on /dev/nst0. ERR=Permission denied. - Label command failed for Volume DLT-20Dec04. Do not forget to mount the drive!!! - Bug: if a job is manually scheduled to run later, it does not appear @@ -281,9 +262,6 @@ Cap: 200GB bacula 1.36.0/1 works with blocksize 16k INSIDE bacula-sd.conf. - Add regex from http://www.pcre.org to Bacula for Win32. - Use only shell tools no make in CDROM package. -- Document PostgreSQL performance problems bug 131. -- Document testing -- Document that ChangerDevice is used for Alert command. - Include within include does it work? - Implement a Pool of type Cleaning? - Implement VolReadTime and VolWriteTime in SD @@ -292,8 +270,6 @@ Cap: 200GB - Look at correcting the time jump in the scheduler for daylight savings time changes. - Add a "real" timer to network connections. -- Write non-optimized bsrs from the JobMedia and Media records, - even after Files are pruned. - Promote to Full = Time period - Despool attributes simultaneously with data in a separate thread, rejoined at end of data spooling. @@ -337,12 +313,14 @@ Documentation to do: (any release a little bit at a time) - Lookup HP cleaning recommendations. - Lookup HP tape replacement recommendations (see trouble shooting autochanger) - Document doing table repair - - -Testing to do: (painful) -For 1.37 Testing/Documentation: +=================================== + +- Use non-blocking network I/O but if no data is available, use + select(). +- Use gather write() for network I/O. +- Autorestart on crash. - Add bandwidth limiting. - Add acks every once and a while from the SD to keep the line from timing out. @@ -354,7 +332,6 @@ For 1.37 Testing/Documentation: units, perhaps via a directive. - If opening a tape in read/write mode fails attempt to open it in read-only mode, and mark the tape for read only. -- Add a read-only mode to the mount option. - Allow Simultaneous Priorities = yes => run up to Max concurrent jobs even with multiple priorities. - If you use restore replace=never, the directory attributes for @@ -464,10 +441,7 @@ For 1.37 Testing/Documentation: should). None of the values 12:00pm - 12:59pm work for that matter. - Add level to estimate command. - For each job type (Admin, Restore, ...) require only the really necessary - fields. -- Fix option 2 of restore -- list where file is backed up -- require Client, - then list last 20 backups. -- Pass Director resource name as an option to the Console. + fields.- Pass Director resource name as an option to the Console. - Add a "batch" mode to the Console (no unsolicited queries, ...). - Add a .list all files in the restore tree (probably also a list all files) Do both a long and short form. @@ -1325,4 +1299,21 @@ Block Position: 0 clients -- Python script? - Look at Preben's acl.c error handling code. - SD crashes after a tape restore then doing a backup. - +- If drive is opened read/write, close it and re-open + read-only if doing a restore, and vice-versa. +- Windows restore: + data-fd: RestoreFiles.2004-12-07_15.56.42 Error: + > ..\findlib\../../findlib/create_file.c:275 Could not open e:/: ERR=Der + > Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen + > Prozess verwendet wird. + Restore restores all files, but then fails at the end trying + to set the attributes of e: + from failed jobs.- Resolve the problem between Device name and Archive name, + and fix SD messages. +- Tell the "restore" user when browsing is no longer possible. +- Add a restore directory-x +- Write non-optimized bsrs from the JobMedia and Media records, + even after Files are pruned. +- Delete Stripe and Copy from VolParams to save space. +- Fix option 2 of restore -- list where file is backed up -- require Client, + then list last 20 backups. \ No newline at end of file diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index a941cb25d4..e65e3103b7 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -599,8 +599,8 @@ struct VOL_PARAMS { uint32_t EndFile; /* End file on Volume */ uint32_t StartBlock; /* start block on tape */ uint32_t EndBlock; /* last block */ - uint32_t Copy; /* identical copy */ - uint32_t Stripe; /* RAIT strip number */ +// uint32_t Copy; /* identical copy */ +// uint32_t Stripe; /* RAIT strip number */ }; diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 857927ac34..efa1253ed4 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -422,8 +422,8 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS Vols[i].EndFile = str_to_uint64(row[5]); Vols[i].StartBlock = str_to_uint64(row[6]); Vols[i].EndBlock = str_to_uint64(row[7]); - Vols[i].Copy = str_to_uint64(row[8]); - Vols[i].Stripe = str_to_uint64(row[9]); +// Vols[i].Copy = str_to_uint64(row[8]); +// Vols[i].Stripe = str_to_uint64(row[9]); } } } diff --git a/bacula/src/dird/sql_cmds.c b/bacula/src/dird/sql_cmds.c index afbe5bbbeb..fd30092491 100644 --- a/bacula/src/dird/sql_cmds.c +++ b/bacula/src/dird/sql_cmds.c @@ -179,24 +179,26 @@ const char *uar_list_jobs = /* MYSQL IS NOT STANDARD SQL !!!!! */ /* List Jobs where a particular file is saved */ const char *uar_file = - "SELECT Job.JobId as JobId, Client.Name as Client, " + "SELECT Job.JobId as JobId," "CONCAT(Path.Path,Filename.Name) as Name, " - "StartTime,Type as JobType,JobFiles,JobBytes " - "FROM Client,Job,File,Filename,Path WHERE Client.ClientId=Job.ClientId " - "AND JobStatus='T' AND Job.JobId=File.JobId " + "StartTime,Type as JobType,JobStatus,JobFiles,JobBytes " + "FROM Client,Job,File,Filename,Path WHERE Client.Name='%s' " + "AND Client.ClientId=Job.ClientId " + "AND Job.JobId=File.JobId " "AND Path.PathId=File.PathId AND Filename.FilenameId=File.FilenameId " "AND Filename.Name='%s' ORDER BY StartTime DESC LIMIT 20"; #else /* List Jobs where a particular file is saved */ const char *uar_file = - "SELECT Job.JobId as JobId, Client.Name as Client, " + "SELECT Job.JobId as JobId," "Path.Path||Filename.Name as Name, " - "StartTime,Type as JobType,JobFiles,JobBytes " - "FROM Client,Job,File,Filename,Path WHERE Client.ClientId=Job.ClientId " - "AND JobStatus='T' AND Job.JobId=File.JobId " + "StartTime,Type as JobType,JobStatus,JobFiles,JobBytes " + "FROM Client,Job,File,Filename,Path WHERE Client.Name='%s' " + "AND Client.ClientId=Job.ClientId " + "AND Job.JobId=File.JobId " "AND Path.PathId=File.PathId AND Filename.FilenameId=File.FilenameId " "AND Filename.Name='%s' ORDER BY StartTime DESC LIMIT 20"; -#endif + #endif /* diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 9189c234b5..25438c3e1a 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -66,7 +66,7 @@ struct RESTORE_CTX { uint32_t TotalFiles; uint32_t JobId; char ClientName[MAX_NAME_LENGTH]; - char last_jobid[10]; + char last_jobid[20]; POOLMEM *JobIds; /* User entered string of JobIds */ STORE *store; JOB *restore_job; @@ -448,13 +448,16 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx) done = false; break; case 1: /* list where a file is saved */ + if (!get_client_name(ua, rx)) { + return 0; + } if (!get_cmd(ua, _("Enter Filename (no path):"))) { return 0; } len = strlen(ua->cmd); fname = (char *)malloc(len * 2 + 1); db_escape_string(fname, ua->cmd, len); - Mmsg(rx->query, uar_file, fname); + Mmsg(rx->query, uar_file, rx->ClientName, fname); free(fname); gui_save = ua->jcr->gui; ua->jcr->gui = true;