Discussion:
[bareos-users] AI - How to purge volumes with type archive automatically?
Martin Prochazka
2018-07-19 09:13:56 UTC
Permalink
Hi,
following the documentation about AI, i am using run script for longterm jobs - changing volume type to A (=archive). Now, those jobs aren't pruned/purged automatically (it need have type full, used, etc).

How to change this status or prune/purge those volumes automatically when file retention expire?

Thanks.
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dan
2018-07-19 17:01:16 UTC
Permalink
Martin -

Once the volumes expire they are eligible to be recycled and reused by the next Long Term job, so there is no need to prune them.

Can you describe why you want to prune/purge the volumes? If I understand the particular problem you're facing, then perhaps I can provide some further advice.

Dan
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Martin Prochazka
2018-07-20 12:05:51 UTC
Permalink
Post by Dan
Martin -
Once the volumes expire they are eligible to be recycled and reused by the next Long Term job, so there is no need to prune them.
Can you describe why you want to prune/purge the volumes? If I understand the particular problem you're facing, then perhaps I can provide some further advice.
Dan
I am using for every job single volume so those files have filename with specific datetime/host info -> recycling not enabled. That's why i need change state from archive or prune/purge before my automatic script will lookup volumes for deleting from disc.
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'thraizz' via bareos-users
2018-07-20 12:34:54 UTC
Permalink
Post by Martin Prochazka
Post by Dan
Martin -
Once the volumes expire they are eligible to be recycled and reused by the next Long Term job, so there is no need to prune them.
Can you describe why you want to prune/purge the volumes? If I understand the particular problem you're facing, then perhaps I can provide some further advice.
Dan
I am using for every job single volume so those files have filename with specific datetime/host info -> recycling not enabled. That's why i need change state from archive or prune/purge before my automatic script will lookup volumes for deleting from disc.
Write a script that uses the output of list volumes, grabs every volume that has the status archive and insert these volume names in 'update volume=<volume name> volstatus=purged'
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Martin Prochazka
2018-07-24 11:02:35 UTC
Permalink
Post by 'thraizz' via bareos-users
Post by Martin Prochazka
Post by Dan
Martin -
Once the volumes expire they are eligible to be recycled and reused by the next Long Term job, so there is no need to prune them.
Can you describe why you want to prune/purge the volumes? If I understand the particular problem you're facing, then perhaps I can provide some further advice.
Dan
I am using for every job single volume so those files have filename with specific datetime/host info -> recycling not enabled. That's why i need change state from archive or prune/purge before my automatic script will lookup volumes for deleting from disc.
Write a script that uses the output of list volumes, grabs every volume that has the status archive and insert these volume names in 'update volume=<volume name> volstatus=purged'
Ugh, i made mistake in the first post. As in documentation, it's setting "type=A" for job, not volume. So volumes has status used,full etc...And retention date is on volume table (=volretention).
So, what now? Make a check for all volumes and purge it on "now-lastwritten>volretention" base? No config syntax, that will do a same effect?
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dan
2018-07-20 14:13:54 UTC
Permalink
Martin -

The purpose of the AI-Longterm job is to create an archive copy of the data that is retained based on the length of the volume retention. If the pool is set up to recycle, then the volume will be automatically purged and recycled when it is needed after its retention period is expired. When Bareos is trying to identify the next volume to use for a job, it goes through the following sequence ...

1. Look for volume with "Append" status.
2. Try finding a recycled volume
3. Try recycling any purged volume
4. Try pruning Volumes
5. Try pulling a volume from the Scratch pool
6. Try "creating" a new Volume
7. Try purging oldest volume
8. Try recycling the oldest volume

Expired volume(s) will be pruned and recycled as needed in step 4. If you go to the trouble of manually scripting them to be purged, then they will be recycled in step 3. You really aren't buying much here.

Here is my AI-Longterm pool configuration for retention of the long term archives for 180 days.

Pool {
Name = AI-LongTerm
Pool Type = Backup
Recycle = yes
Auto Prune = yes
Maximum Volume Bytes = 10G
Label Format = "AI-LongTerm-"
Volume Use Duration = 2 days
Storage = FileVLT
Volume Retention = 180 days
Maximum Volumes = 100
}

Bareos is designed to reuse/recycle volumes. Using a volume 1 time and scripting a deletion from the file system isn't a typical use case. If you have a requirement to do it that way and never recycle a volume, then you can just as well write a script to delete the volume from the Catalog rather than just purge it. Note that 'Expired' is not a valid state for a volume, that is just what is displayed when the current time minus the last written time exceeds the volume retention period. So to select those volumes in a script you'll have to query based on that timestamp math.

Dan
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...