cancel
Showing results for 
Search instead for 
Did you mean: 

how to change change retention on media existing

T_N
Level 6

I have netbackup 7.7.2 running on solaris. I want to change retention on media existing. My question is how can I change the media existing from 2 weeks retention to 1 month retention. Anyone has script, please share it to me, thank you.

 


Tom

1 ACCEPTED SOLUTION

Accepted Solutions

Genericus
Moderator
Moderator
   VIP   

I keep these type of commands in a file, so I can find them again - 

This find images for clients (x) in list, with backups from (d) to (e) with Schedule (sl), cuts the image and then uses these image values ($i) and recalculates copy 2 to retention 13 

for x in `ls -1d /usr/openv/netbackup/db/images/client*`
do
for i in `bpimagelist -idonly -d '01/01/2017' -e '03/23/2017' -client $x -sl Weekly_Full_Backup | cut -d " " -f10`
do
echo "Changing Backup ID: "$i at `date +%Y%m%d.%H%M`
/usr/openv/netbackup/bin/admincmd/bpexpdate -recalculate -backupid $i -copy 2 -ret 13 -force
done
done

 

p.s .I just realized, I did not update my dates in the last post - you cannot end date before start date, lol

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS

View solution in original post

2 REPLIES 2

Genericus
Moderator
Moderator
   VIP   

Depending on what you are asking, the answer will vary.

Say you have media with an image on it that is retention 10, and retention 10 is set to 2 weeks.

Do you want to change retention from 10 to 12 on these media and recalculate the expiration?

Do you want to change retention 10 from 2 weeks to 4 weeks on these media and recalculate?

Do you want to leave the retention value alone, and just change the expiration date on the image?

Do you want to change the expiration for everything on a media?

You are tag says Solaris. 

You can use some loops to find all images and update the expiration, etc.

Please be careful since it is really easy to do more than you expect!

You can use bpimagelist and values for date/client/policy/etc to select images, like

/usr/openv/netbackup/bin/admincmd/bpimagelist -media -U -d "08/10/2017 00:00" -e "08/10/2013 23:56" -client "client-backup" | cut -c0-6 | sort -u >  /var/tmp/tape.move.list ( this is for entire media )

This creates a list you can then run bpexpdate against the list 

/usr/openv/netbackup/bin/admincmd/bpexpdate -m $i -d "12/31/2017 23:59" -force -notimmediate ( changes all images on media )

I am pretty sure to recalculate, you need to find all the images, instead of the media

You should man the commands, since some need image values, and some need media values, depending on what you need.

 

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS

Genericus
Moderator
Moderator
   VIP   

I keep these type of commands in a file, so I can find them again - 

This find images for clients (x) in list, with backups from (d) to (e) with Schedule (sl), cuts the image and then uses these image values ($i) and recalculates copy 2 to retention 13 

for x in `ls -1d /usr/openv/netbackup/db/images/client*`
do
for i in `bpimagelist -idonly -d '01/01/2017' -e '03/23/2017' -client $x -sl Weekly_Full_Backup | cut -d " " -f10`
do
echo "Changing Backup ID: "$i at `date +%Y%m%d.%H%M`
/usr/openv/netbackup/bin/admincmd/bpexpdate -recalculate -backupid $i -copy 2 -ret 13 -force
done
done

 

p.s .I just realized, I did not update my dates in the last post - you cannot end date before start date, lol

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS