cancel
Showing results for 
Search instead for 
Did you mean: 

Need advice on purging files a week after they have been backed up

backupdude
Level 2
What is the best way to purge files a week after they have been backed up. I'm pretty sure this will be a scripting job, and I am thinking of a bpstart_notify script. My environement is all unix so that is something to take into account. Also is there a way that bparchive could satisfy this situation as well? What would be the best approach to achieve this?
1 ACCEPTED SOLUTION

Accepted Solutions

dltsc
Level 4
Partner
You could verify the files have been backed up using bplist and comparing the mtime and file size from the bplist output with that of the actual files.  So I'm thinking the process would like like this:

1) Use find command to identify files older than 1 week, save output to a file (somefile.txt)
2) Use a loop to go through somefile.txt one line at a time and run the bplist command to see if the specific files have been backed up
3) Delete files that have been backed up

View solution in original post

3 REPLIES 3

dltsc
Level 4
Partner
So you have a directory of files that you back up and then a week later you'd like to delete those files so they do not get backed up again?  Could you write a script that uses the find command to obtain a list a files that are older than 1 week and delete them?  Not sure if that's what you're looking for.

backupdude
Level 2
Basically, yes. However, I want to verify with Netbackup that those files that are being deleted have in fact, been backed up. The main key is verifying that files were indeed backed up by netbackup. I'm not sure how to verify this, (bplist? mtime?).

Thanks.

dltsc
Level 4
Partner
You could verify the files have been backed up using bplist and comparing the mtime and file size from the bplist output with that of the actual files.  So I'm thinking the process would like like this:

1) Use find command to identify files older than 1 week, save output to a file (somefile.txt)
2) Use a loop to go through somefile.txt one line at a time and run the bplist command to see if the specific files have been backed up
3) Delete files that have been backed up