Forum Discussion

JohnnyBgood's avatar
12 years ago

How to delete backups successfully that are 5 years old.

NBU Version:  7.1.0.3

Master Svr:  Solaris

Meida Svr 1:  Red Hat Linux

Media Svr 2:  Red Hat Linux

Data Domain  DD690

 

I found some old backups that I want to delete but want to ensure that I do it properly.

After running this command I found one client that has backup images that are 5 years old.

>ls -ltr `find . -name '<client name>*'` | more

>rm Rf `find . -name '<client name>*'` | more

 

Thanks for you help!

 

 

 

  • Once you determine the backup ids, you simply expire the images: bpexpdate -d 0 -backupid -force The bpimagelist -idonly was what I was going to suggest. You only run the command once, either from a media or the master Not possible to do all at once, has to be individual against each backupid, though you could script it in a loop. Martin

9 Replies

  • Where exactly did you run that command, as in, which directory.

    or to put another way ....

    Exactly what files have been deleted from what directory.

    Thanks,

    Martin

  • I only ran the first command to find the oldest which gave me everything for that particular client from 2009 to present.  Please excuse the second command, my fault for typing it out.  I haven't removed anything yet.  I was merely typing it out as to show you what I might do then I looked at the command and thought that would of been a big NO NO... Obviously I need to find a command that would narrows my search to date and year.  I think I need to use -mtime like this: 1095 days = 3 years

    >ls -ltr `find . -name '<client name>*'` -mtime -1095`

     

    I ran >ls -ltr `find . -name '<client name>*'` | more

    on the Master Server from this directory /dd01/backup

    there is another directory as well /dd02/backup

    The same directory for the media servers as well.

  • Martin,

     

    I caught Marianne's post via search.  I beleive option 2 is what I'm looking at.  By running these commands on the master server will I have to run the same commands from the media servers as well in order to delte these backup jobs that are almost 5 years old?  I just want to keep only at best 2 years of backups and delete the rest in order to free up some space on my Data Domain.  Thanks for your help.

    Two was to expire backups:


    1. If previous backups were done to tape, you can list all media id's that contain valid backups and expire all images on each media id. Use the GUI reports and run Media List report or run bpmedialist from cmd.
    Expire each media-id using bpexpdate command: bpexpdate -m <media-id> -d 0


    2. If backups were done to disk, you need to list all image id's that falls within the period that you don't need anymore and expire them:
    bpimagelist -idonly  -d <start-date>  -e <end-date>
    bpexpdate  -backupid <backup id> -d 0

     

  • from master:

    /usr/openv/netbackup/bin/admincmd

    I ran >./bpimagelist -idonly -d 01/01/2009 00:00:01 -e 12/31/2010 23:59:00

    Result:  All client backups between the beginning of 2009 and end of 2010.

    What command do I use to delete them all at once since there is more than one unique ID.  I have around about 30-40 clients in this list it appears.

    Lastly, do I run the same command from the media servers as well.

     

    Thanks again for you help.

  • I should probably ask to be certain. 

    Do I run the command from both directories dd01/backup and dd02/backup from master as well as both media servers.

     

    Thanks Martin!

     

     

  • Once you determine the backup ids, you simply expire the images: bpexpdate -d 0 -backupid -force The bpimagelist -idonly was what I was going to suggest. You only run the command once, either from a media or the master Not possible to do all at once, has to be individual against each backupid, though you could script it in a loop. Martin
  • Once you determine the backup ids, you simply expire the images: bpexpdate -d 0 -backupid -force The bpimagelist -idonly was what I was going to suggest. You only run the command once, either from a media or the master Not possible to do all at once, has to be individual against each backupid, though you could script it in a loop. Martin