Johncu
16 years agoLevel 3
Loop script to expire images using bpexpdate
Hi
I am not great at scripting, and I have a few images I would like to manually expire.
I have copied them all into an input file and atempted to write a simple loop script as follows:
for x in `cat /opt/openv/netbackup/scripts/input` do sed "/opt/openv/netbackup/bin/admincmd/bpexpdate -recalculate -backupid $y -d 0"
done
however it is not working returning 'Unrecognized command'
does anyone have a script I could use to manual expire all my images, I don't want to have to type in the bpexpdate comand for each and every one.
Many thanks
- with a list of images you need changed, name it whatever
for i in `cat image_list`
do
echo $i
<install_path>/openv/netbackup/bin/admincmd/bpexpdate -backupid $i -d 0
done
not sure why you are using sed
***EDIT***
Make sure you are running your script as root, if not, make sure you add sudo to the command in the script