11-03-2010 07:20 AM
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 !
Solved! Go to Solution.
11-03-2010 07:51 AM
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
11-03-2010 07:51 AM
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
11-03-2010 08:03 AM
What is cat backupid.list from above ?
11-03-2010 08:12 AM
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!
11-03-2010 08:29 AM
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
$
11-03-2010 08:32 AM
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!
11-03-2010 08:47 AM
$ 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
11-03-2010 08:56 AM
remove the . before /usr
11-03-2010 08:56 AM
Are you running this on the master?
11-03-2010 08:57 AM
11-03-2010 09:01 AM
After removing . before /usr it went fine
11-03-2010 09:04 AM
& I'll give Riaan an additional thumbs up for having younger eyes than me!
11-03-2010 09:05 AM
Nah, I'm just correcting grammar, lol
11-03-2010 08:33 PM
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