Showing results for 
Search instead for 
Did you mean: 

BEMCLI adjust media expiration

Level 4

Can anyone tell me if there is a way, in 2019, of using BEMCLI to adjust the media expiration date of some B2D media?

We are adjusting our retention strategy and I have literally thousands of B2D file stored on a DXi that need their expiration date adjusting prior to DLM process.

Obviously right-click method is not appropriate, when i can powershell through the lot.

Any tips?



Level 6

There is no current method thru BEMCLI to change disk media expiration.




Employee Accredited Certified

If you are concerned that some backup sets might get reclaimed before you can adjust their expiry then you can temporarily disable all DLM activity using the info in this article


Also inside the Backup Exec console you can multi-select the backup sets (using combinations of CTRL or SHIFT with mouse clicks) and then right click and choose Expiration to change the dates across multiple sets. This means you could select blocks of sets that you want to have the same expiration and set them all in one go. Note: You can sort the lists of backup sets by server name, dates of jobs etc should be possible to make it easier to select a lot in one go to have the same expiration.




Disappointing about the lack of automation\programmability.  Would think this kind of operation (single operation against thousands or tens of thousands of objects) would be prime for scripting.  On a basic level it's all just SQL in BEDB right?  The APIs are there as the console uses them?

But thank you Colin i will pursue your suggestion of manipulating the console to reduce the pain a little.


Unfortunately the Storage tab \ Backup Sets page does not show any details of the jobs that created the backup sets, so I am unable to identify which backup set belongs, for example, to a daily, weekly or monthly job.

I can see server name, storage, Backup time, current expiration etc. - but without being able to identify which job created the media, I don't stand a chance.

Any ideas or other ways of looking at this?



Employee Accredited Certified

Hmm I can't think of a way to get around needing to know which are weekly, month daily. You will have to base any changes  on the dates.

Just for info though - if BEMCLI did provide a way to change the expiration date, then scripting exactly which sets to change would also be very difficult.




I suppose conceptually i had something like the following in mind.

The actual expiration date would need either be worked out by "media creation date + desired retention = actual expiration date" - OR - the cmdlet would be clever enough to translate itself a retention period of 3 months based on the creation date.  Either way should be doable.  Dirty :) but doable.

(Cmdlets are made up out of my head and probably aren't the right ones - but the concept stands.)

$medialist = get-bejob | where-object $ -contains "Daily" | get-bemedia

for-each ($mediafile in $medialist) {
$creationdate = $mediafile.creationdate (or whatever property)
$expirationdate = $creationdate + <whatever>
set-mediaretention -media $mediafile -expirationdate $expirationdate (or -retentionperiod "3months")

So something really basic like that. 


Employee Accredited Certified

The problem is actually a background issue to do with which parts exist inside the BEDB and which parts only exist in the catalogs  and the fact that coding wise the links  between catalog and BEDB that would be needed to achieve what you are after are not present (In other words the separate information is not always provided in a way that can return results via a SQL query)

So yes we could eventually rewrite/change code to achieve something like what you are asking for but as things stand with the current coding there is no obvious way for an end customer to achive what you have asked for.


EDIT: Oh and for info as a backup set could use more then one piece of media, any coding/scripting would have to look at the set information and not the media information, only mentioning this as it looks like you may need to understand that DLM manages the expiry of backup sets (which then has an effect on specific media)