10-20-2009 08:14 AM
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
Solved! Go to Solution.
10-20-2009 08:29 AM
10-20-2009 08:29 AM
10-20-2009 08:52 AM
for x in $(</opt/openv/netbackup/scripts/input)
do
echo "working on image $x"
/opt/openv/netbackup/bin/admincmd/bpexpdate -recalculate -backupid $x -d 0
done
the for loop will read in the contents of the file input one line at a time
it will then put that item where ever $x appears
it will then loop until there are no more line items in the file input.
10-20-2009 08:58 AM
both working great, many thanks!