cancel
Showing results for 
Search instead for 
Did you mean: 

Netbackup script Needed

tapeadmin1
Level 4

Hi,

 

I need to change the image experation for about 160 backup_id 's using bpexpdate. can any one please provide the script for this ?

Thank You !

1 ACCEPTED SOLUTION

Accepted Solutions

Andy_Welburn
Level 6

You're basically going to need a list of the affected backupids & feed that into the bpexpdate command as best as you see fit!

e.g. (there are probably much more streamlined methods, but...)

cat backupid.lis |

while read BACKUPID

do

bpexpdate -backupid $BACKUPID -d [your new expiration date] -force

done

View solution in original post

13 REPLIES 13

Andy_Welburn
Level 6

You're basically going to need a list of the affected backupids & feed that into the bpexpdate command as best as you see fit!

e.g. (there are probably much more streamlined methods, but...)

cat backupid.lis |

while read BACKUPID

do

bpexpdate -backupid $BACKUPID -d [your new expiration date] -force

done

tapeadmin1
Level 4

What is cat backupid.list from above ?

Andy_Welburn
Level 6

I take it that as you are asking this question you're not interested in a UNIX resolution to your question?

Basically cat backupid.lis will print out to the screen the contents of the file backupid.lis (i.e. the list of backup ids that you've already prepared!). The | (pipe) sends the output from this into the following command(s). So essentially it will read each entry of that file (i.e. your backup ids) & run the bpexpdate command on each one.

So endeth UNIX 101!

Windows commands will be lesson 102!

tapeadmin1
Level 4

I am getting the following error:

 

$ cat backupid.lis |
> while read BACKUPID
> sudo ./usr/openv/netbackup/bin/admincmd/bpexpdate -backupid $BACKUPID -d 11/03/2017 -force
> done
ksh: syntax error: `done' unexpected
$
 

Andy_Welburn
Level 6

while read ....

do

......

done

***EDIT***

I would be tempted to only have one backup id in your list also, just in case you get your date wrong!

tapeadmin1
Level 4

$ cat backupid.lis |
> while read BACKUPID
> do
> sudo ./usr/openv/netbackup/bin/admincmd/bpexpdate -backupid $BACKUPID -d 11/03/2017 -force
> done
Password:
sudo: ./usr/openv/netbackup/bin/admincmd/bpexpdate: command not found
 

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

remove the . before /usr

Andy_Welburn
Level 6

Are you running this on the master?

Andy_Welburn
Level 6

blush

tapeadmin1
Level 4

After removing . before /usr it went fine

Andy_Welburn
Level 6

& I'll give Riaan an additional thumbs up for having younger eyes than me!

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

Nah, I'm just correcting grammar, lol

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

Hi,

 

Please mark Andy's post as the solution, not mine, he gave you the script, i just corrected your error with the .

 

Thanks

 

R