Deleting images manually
The images on disk will be deleted randomly after they are stored on the tapes. I know that many people are using SLPs to control the deletion. Unfortunately I haven't a license for Advanced Disk therefore I'm not able to use a SLP for doing me the job. But I want to have only the newest images on disk. So my idea is a script:
First I need a list with the backup IDs which are older than let's say 8 days. (With bpimagelist?)
The list will be then used in a loop. The current backup ID in the loop will be verified whether it is already on tape. If yes, the image will be marked as expired based on the backup id. (Expiring images with bpexpdate -notimmediate?)
At the end the expired images should be deleted from disk. (With nbdelete?)
Is the above train of thought right? I don't know exactly which command is the right and which options are needed. I hope you can help me :)
And here is my script.
#!/bin/sh
DATE=`which date`
BPIMMEDIA=/usr/openv/netbackup/bin/admincmd/bpimmedia
BPEXPDATE=/usr/openv/netbackup/bin/admincmd/bpexpdate
NBDELETE=/usr/openv/netbackup/bin/admincmd/nbdeleteENDDATE=`${DATE} --date='8 days ago' '+%m/%d/%Y %T'`
BACKUPIDS=`${BPIMMEDIA} -disk -e ${ENDDATE} -dt 1 | grep '^IMAGE' | awk '{print $4}'`for BACKUPID in ${BACKUPIDS}
do
${BPEXPDATE} -force -backupid ${BACKUPID} -d 0 -copy 1 -notimmediate
done${NBDELETE} -allvolumes