Forum Discussion

day's avatar
day
Level 3
10 years ago

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 the...
  • day's avatar
    10 years ago

    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/nbdelete

    ENDDATE=`${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