a Backup Headscratcher.....
Discussion
DB2 backup.
Now, before you all run away, I only want to delete the file once its been backed up!
Heres the situation:
I have 4 DB2 databases on a Wintel server that need backing up. I don't have a DB2 plugin for BackupExec so I'm doing it via the following method:
1) Stop the database
2) Use a DB2 backup command to snapshot the database into a folder (D:/DB2BACKUP)
3) Start the database
4) Run the backup job
Now, this would all be fine, but DB2 places it into the following folder structure under D:/DB2BACKUP:
DB2/NODE0000/CATN0000/20040429
What I want to do once the backup has finished is delete the 20040429 folder and the DB2 file within it. Herein lies the problem. The folder is basically todays date, so I need a way of capturing what that folder is called. Initially I thought I could simply use the DOS RD command but that relies on you knowing what the folder is called. If I ran it one level up (i.e. at CATN0000) it would also delete other files that may legitimately be there, so I can't do that.
Any ideas? Its got me a bit
>>> Edited by GregE240 on Thursday 29th April 15:11
Now, before you all run away, I only want to delete the file once its been backed up!
Heres the situation:
I have 4 DB2 databases on a Wintel server that need backing up. I don't have a DB2 plugin for BackupExec so I'm doing it via the following method:
1) Stop the database
2) Use a DB2 backup command to snapshot the database into a folder (D:/DB2BACKUP)
3) Start the database
4) Run the backup job
Now, this would all be fine, but DB2 places it into the following folder structure under D:/DB2BACKUP:
DB2/NODE0000/CATN0000/20040429
What I want to do once the backup has finished is delete the 20040429 folder and the DB2 file within it. Herein lies the problem. The folder is basically todays date, so I need a way of capturing what that folder is called. Initially I thought I could simply use the DOS RD command but that relies on you knowing what the folder is called. If I ran it one level up (i.e. at CATN0000) it would also delete other files that may legitimately be there, so I can't do that.
Any ideas? Its got me a bit
>>> Edited by GregE240 on Thursday 29th April 15:11
Are Node0000 and Cat0000 statics?
If so build the string and then pass using todays date (I may be able to sort you out a Date7 conversion program tommorow (not at work)) today as an argument to a batch file and do the delete from there?
Alternatively swerve the backup process and use DTS to fill a file on SQL Server.
Any good?
If so build the string and then pass using todays date (I may be able to sort you out a Date7 conversion program tommorow (not at work)) today as an argument to a batch file and do the delete from there?
Alternatively swerve the backup process and use DTS to fill a file on SQL Server.
Any good?
Plotloss said:
Are Node0000 and Cat0000 statics?
You're right Matt, they are. For example, you might have sub folders like:
/20040429
/20040331
And so forth. DB2 creates the folder based on the date, as you say.
Plotloss said:
If so build the string and then pass using todays date (I may be able to sort you out a Date7 conversion program tommorow (not at work)) today as an argument to a batch file and do the delete from there?
I think that will do it. As I said, RD removes the folder you run it from too, so no good running at the CAT0000 level as you may remove a load of other databases!
Plotloss said:
Alternatively swerve the backup process and use DTS to fill a file on SQL Server.
Any good?
DTS probably isn't an option, but I like your first idea Matt - thanks mate.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff