In response to Beren <[EMAIL PROTECTED]>: > Hi Everyone, > > I'm running 1.38.3 with MySQL on RedHat EL3 with an Autochanger. > > The other day, every single tape in my library was marked as either > Used or Full. It had been about 4 weeks since bacula purged any > volumes. To force it, I ran a backup job, and bacula marked 6 tapes > are Purged and one volume as Recycled. - Shouldn't bacula purge > volumes outside of their retention period at the start of each backup? > Why did it wait until there was no space left to do this? How can I > force it otherwise it's very hard for a less technical operator to > know which tapes to load. > > Also, when it recycles a volume, it's hit and miss as to whether it > recycles a volume which is in the library or not. - This has been a > long standing issue with bacula.. how can I override bacula's desire > to want to keep my data for as long as possible and not consider > volumes which are not in the autochanger? We just have to meet SLA, > which is to be able to restore a file from any day within the last two > weeks plus monthlies.
I've been struggling with this myself. For our tape rotation, we have 3 weekly tapes and a whole bunch of archive tapes. Every four weeks we run an archive tape, and the other three weeks we rotate through the 3 weekly tapes. We call the weekly tapes rotation[012] and the montly tapes are named after the week of the year that they'll be used: i.e. week27 Note the output of 'list volumes': Pool: OffSite +---------+---------------------------------------+-----------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+ | mediaid | volumename | volstatus | volbytes | volfiles | volretention | recycle | slot | inchanger | mediatype | lastwritten | +---------+---------------------------------------+-----------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+ | 9 | rotation1.year2006.tape000102.pitbpa0 | Used | 37,185,373,673 | 48 | 1,814,400 | 1 | 0 | 1 | LTO2 | 2006-05-26 01:17:54 | | 17 | rotation2.year2006.tape000103.pitbpa0 | Used | 76,717,564,796 | 88 | 1,814,400 | 1 | 0 | 1 | LTO2 | 2006-06-02 07:36:11 | | 19 | week19.year2006.tape000121.pitbpa0 | Used | 31,828,347,891 | 42 | 63,072,000 | 1 | 0 | 1 | LTO2 | 2006-05-12 05:06:22 | | 20 | week23.year2006.tape000122.pitbpa0 | Used | 76,185,369,773 | 86 | 63,072,000 | 1 | 0 | 1 | LTO2 | 2006-06-09 06:21:38 | | 21 | week27.year2006.tape000123.pitbpa0 | Append | 1 | 0 | 63,072,000 | 1 | 0 | 1 | LTO2 | | | 22 | week31.year2006.tape000124.pitbpa0 | Append | 1 | 0 | 63,072,000 | 1 | 0 | 1 | LTO2 | | | 23 | week35.year2006.tape000125.pitbpa0 | Append | 1 | 0 | 63,072,000 | 1 | 0 | 1 | LTO2 | | | 24 | week39.year2006.tape000126.pitbpa0 | Append | 1 | 0 | 63,072,000 | 1 | 0 | 1 | LTO2 | | | 25 | week15.year2006.tape000120.pitbpa0 | Used | 2,956,052,066 | 14 | 63,072,000 | 1 | 0 | 1 | LTO2 | 2006-04-19 04:49:54 | | 26 | rotation0.year2006.tape000101.pitbpa0 | Append | 95,037,612,740 | 106 | 1,814,400 | 1 | 0 | 1 | LTO2 | 2006-06-16 04:06:58 | +---------+---------------------------------------+-----------+----------------+----------+--------------+---------+------+-----------+-----------+---------------------+ Note that rotation0 was just used last night. Yesterday is when the problem occurred. I have a cron job that checks to ensure a tape is in the drive Thursday afternoon, so I have some warning and a reminder to make sure everything is ready for Thursday night. It's a PITA to find out Friday morning that backups didn't run, as it's then difficult to get the problem fixed and the backups finished before the courier shows up to take the tape to the vault. Anyway. Yesterday I get an email from my cron job, bitching because there's no tape in the drive. NP, I put in rotation0 and check Bacula to be sure it's mounted. Everything looks good except rotation0 is still in the Used state. So I figure I'll just make sure everything is OK. I manually start one of the backup jobs (on the assumption that it will prune volumes and rotation0 will recycle). Unfortunately, the job blocked because rotation0 was unacceptable. (BTW: kudos to whoever is writing these error messages! The message said something like "rotation0 in drive is unacceptable because it's not in state append, please insert another tape") Anyway, I checked the dates, and rotation0 was eligible for recycling on June 9. Yet it's still marked Used. Sure am glad I checked up on this! So I manually issued "prune" and I got a message that many jobs had been pruned from rotation0. Problem is that rotation0 is _still_ marked Used. Manually issuing prune a second time finally makes it eligible for use. So I apparently don't have a full grasp of how pruning and rotation works. It does seem as if prune is non-recursive. IOW, when jobs are pruned, the prune routines don't seem to realize that doing so has freed up a volume. The second prune didn't prune any jobs, but it did seem to notice that there was nothing left on the volume, and thus the volume could recycle. Now, since this volume has been eligible for recycling since last Friday, why did it not recycle automatically? The volume config looks like this: Pool { Name = "OffSite" Pool Type = Backup AutoPrune = yes # Length of time before a tape is considered used up Volume Use Duration = 23 hours # how long before the tape is recycled Volume Retention = 2 years # Reuse the tape if older than "Volume Retention" Recycle = yes } This pool is only used once a week, on Thursday night when backups are written to tape for offsite storage. Daily backups are done to disk pools on (obviously) a different storage device. Does bacula only autoprune volumes if it's working with that storage/pool? If so, should reducing the VolumeRetention from 21 to 20 days fix the problem? Am I hitting a fencepost calculation? Is there some way to tell Bacula to autoprune all volumes on a regular basis? -- Bill Moran Collaborative Fusion Inc. _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users