On Tue, 6 November, 2007 11:46 am, Kern Sibbald wrote: > On Monday 05 November 2007 23:57, GDS.Marshall wrote: >> Hello, >> >> Would someone please confirm this for me. >> OS: Linux 2.6.2x >> bacula: 2.2.5 >> patches: >> 2.2.5-deamon.patch >> 2.2.5-lastwritten.patch >> 2.2.5-nextvol.patch >> 2.2.5-postgresql-errors.patch >> 2.2.5-tray-monitor.patch >> >> I am looking at has_volume_expired to modify it, but ended up doing some >> debugging. With the exception of the following two lines, have made no >> other changes. I added the following debugging: >> line 165 src/dird/next_vol.c added >> Dmsg3(100, "MediaId=%d VolJobs=%d FirstWritten=%d\n", mr->MediaId, >> mr->VolJobs, mr->FirstWritten); >> >> line 194 src/dird/next_vol.c added >> Dmsg2(150,"has_volume_expired VolUseDuration=%d >> FirstWritten=%d\n",mr->VolUseDuration, mr->FirstWritten); >> >> In one shell I ran bacula-dir with the following >> /home/gdsm/src/bacula-2.2.5/src/dird/bacula-dir -f -d 300 -c >> /etc/bacula/bacula-dir.conf -u bacula -g bacula >> >> In another shell I ran bconsole >> status dir >> >> >> bacula-dir produced the follwing output >> backup-dir: next_vol.c:165-0 MediaId=40 VolJobs=13 >> FirstWritten=1194231601 >> backup-dir: next_vol.c:194-0 has_volume_expired VolUseDuration=82800 >> FirstWritten=0 >> >> I then ran a select >> select MediaId,VolJobs,FirstWritten from Media where MediaId=40; >> +---------+---------+---------------------+ >> >> | MediaId | VolJobs | FirstWritten | >> >> +---------+---------+---------------------+ >> >> | 40 | 13 | 2007-11-05 03:00:01 | >> >> +---------+---------+---------------------+ >> >> So line 194 of src/dird/next_vol.c should not produce 0 for FirstWritten >> >> The problem I would like someone to confirm is the FirstWritten. >> Line 165 next_vol.c shows FirstWritten=1194231601 >> Line 166 next_vol.c calls has_volume_expired >> Line 194 next_vol.c first line in has_volume_expired shows >> FirstWritten=0 >> >> Is this expected? If I have laboured the point, I apologise, I just >> want >> to make sure I have explained my findings properly. > > Yes this is expected because your debug code that you added at line 194 is > incorrect (has a bug). You didn't actually display FirstWritten, and > FirstWritten is not actually zero. I should have done some more debugging. But then I would not have learnt so much.
Despite believing you, I put separate Dmsg1's and sure enough, each value was printed as expected. I looked at FirstWritten and it is a time_t which is a long int. That said, I changed the %d for a %ld, and that did not work. I tried a multitude of permutations, none of which worked. That said, I think I have "status dir" doing what I set out to do. (I have the FSFE printed to send off). If tonight's backup at work goes okay (I am using them as a guinea pig, I will let you have it for your comments. > > If you cannot figure out the bug in a day or two, ask and I'll explain. > > Kern Regards, Spencer ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
