On Apr 5, 2011, at 1:34 PM, Martin Simmons wrote: >>>>>> On Tue, 5 Apr 2011 14:35:07 +0100, Dermot Beirne said: >> >>>>>>>> On Tue, 5 Apr 2011 07:40:44 +0100, Dermot Beirne said: >>>> >>>> I'm sure that would be fine, but I'm having difficulty automatically >>>> determining which volumes are ok to prune. I need to compare the last >>>> written time to the current time and the volumes retention, and check the >>>> job type and status too to narrow the selection. >> >>> Why do you need to do that? The prune jobs command does most of what you >>> want, using the configured retention times etc. >>> >>> __Martin >> >> I am trying to prune Volumes, not jobs. >> >> If I use the prune command manually, I have to know what volume I want >> it to prune, and which pool it's in. >> >> To identify the volume, I need to check that it's past it retention >> time before I prune it. >> >> I currently have a volume in a pool which is several weeks past it's >> retention time. >> The mediaid is 986. >> >> After running prune, choosing Volume, and then the pool, I am >> presented with a list of volumes in that pool. >> >> When I enter the ID, it tells me the current retention time is 2 days, >> even though it was last written to back in January: >> >> Enter *MediaId or Volume name: *986 >> The current Volume retention period is: 2 days >> Continue? (yes/mod/no): >> >> I have to choose Yes to get it to prune it. >> >> Is the above normal, and is there some way, given a pool, it will just >> prune any volume in that pool past the retention. > > Yes, the above is normal for the prune volumes command. To remove the > prompts, try > > prune volume=blahblah yes > > It only works with a volume name, not an id. > > Bacula's automatic recycling only kicks in when it runs out of appendable > volumes, so a volume could easily remain in the Used state for a long time > past its retention period. > > You could also try > > prune jobs client=... > > to prune all jobs for a client based on the Job Retention period and then use > SQL to find the volumes that have no remaining jobs. > > >> I want that to happen on a schedule, to both clear old disk volumes >> and free space (using truncate), and also for my Tape volumes, to put >> them back in the scratch pool automatically once expired. >> Currently, when scratch tapes run low, I have to go through my Tape >> volumes, and purge the oldest manually. Even then, they only >> sometimes go to the scratch pool, other times I have to manually >> change the pool to the Scratch pool after purging. > > Sorry, I don't use the Scratch pool so I don't know if/how that is supposed to > work. > > >> The Next Pool directive is set to Scratch in the Pool configuration >> for all my Tape pools. > > Should that be the Scratch Pool directive, not Next Pool?
>I think you are correct. Next Pool is for Migration/Copy, not for Scratch. > >I think the OP wants: RecyclePool > >http://bacula.org/5.0.x-manuals/en/main/main/Configuring_Director.html#SECTION0018150000000000000000 > >RecyclePool = pool-resource-name >This directive defines to which pool the Volume will be placed (moved) when it >is recycled. Without this directive, a Volume will >remain in the same pool >when it is recycled. With this directive, it can be moved automatically to any >existing pool during a >recycle. This directive is probably most useful when >defined in the Scratch pool, so that volumes will be recycled back into the >>Scratch pool. For more on the see the Scratch PoolTheScratchPool section of >this manual. >Although this directive is called RecyclePool, the Volume in question is >actually moved from its current pool to the one you specify >on this directive >when Bacula prunes the Volume and discovers that there are no records left in >the catalog and hence marks it as >Purged. Hi, I mixed up my directives in my comment above, but I am using the correct ones as described by Dan in my configuration. See here my Daily-Disk-Pool, followed by the corresponding Daily-Tape-Pool to which the disk volumes are migrated. Pool { Name = Daily-Disk-Pool Pool Type = Backup Label Format ="Daily-Disk-Vol-" Maximum Volume Bytes = 50G Volume Use Duration = 1 days Maximum Volume Jobs = 5 Recycle = yes AutoPrune = yes Storage = DailyStorage Next Pool = Daily-Tape-Pool //which pool to move the volume to during migration RecyclePool=Daily-Disk-Pool //which pool to put the volume in after recycling Recycle Oldest Volume = yes Maximum Volumes = 36 ActionOnPurge = Truncate Volume Retention = 2 days } Pool { Name = Daily-Tape-Pool Pool Type = Backup Storage = Tape Recycle = yes AutoPrune = yes Cleaning Prefix = "CLNU" RecyclePool = Scratch Volume Use Duration = 23h RecycleOldestVolume = yes Volume Retention = 13 days } Re the original topic, to answer Martin's suggestions: I can't use the prune jobs client, due to a bug which requires me to set the File and Job retention to excessively high values in the Client Resource, and let the volume retention prune the whole lot, as it take precedence. When the job and file retentions are specified in the pool, the lowest retention is used for all types of backups for that client, so my method is a workaround, until this bug is fixed. I'm aware that automatic recycling only kicks in when it runs out of appendable volumes, which is the exact cause of my problems! For disk volumes, if i don't specify a maximum number of volumes per pool, it will only start recycling when all disk space has run out. Its' a fine balance between having enough volumes allowed in each pool to avoid running out of space, and yet allow the backups to complete. I need to free this space as quickly as possible after successful migration, to make it available to other pools. My monthly-disk-pool for example, is only used once a month. About 2 days after the monthly backups to disk, they are all migrated onto tape. For the next 3 weeks, the Daily and Weekly Pools need disk space to complete, and there are 100's of Gb of disk space used by the monthly-disk-pool which is sitting there unnecessarily, because it's been migrated, and has passed it's retention, but I am unable to automatically free this space for the Daily and Weekly pools to use. For my tapes, again it will only recycle the tapes when the scratch pool is empty. I can't leave it until this happens, as backups will stop, and it will just sit waiting for me to load whatever random tape it has decided to recycle. I want to be able to make it check which volumes have passed their retention, and prune them immediately, placing them back into the Scratch pool. It becomes self managing. The actiononpurge=truncate feature was brought in to deal exactly with my disk volume issue, but it appears to have a massive omission. It will only purge (and therefore truncate) the disk volume when it needs a volume, not in advance, so I don't see the point of it at all. When it needs to recycle a volume, it will truncate it anyway and start overwriting it, so this feature achieves nothing on it own that I can see. >From reading this list a number of users have coded their own solutions to what I am trying to do, so if someone can share their solution, I'd be most grateful. Dermot. ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users