By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,007 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,007 IT Pros & Developers. It's quick & easy.

Automatically delete old backup dumps

P: n/a
Hi all,

This one's probably super easy and I'm just not finding the right
command/job:

I've already set up a scheduled backup job that dumps the contents of
my DB2 (ver 8.1) database to a folder on my hard drive nightly (it is
then backed up on a tape). However, I have no idea how to
automatically delete old backup dump files (I've been doing it
manually each morning). MS-SQL 2000 and 2005 are pretty
straightforward with their wizards, but I'm not seeing anything in
DB2. Where do I go?

Thanks!
John

Mar 6 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Mar 6, 5:00 pm, snocone...@gmail.com wrote:
Hi all,

This one's probably super easy and I'm just not finding the right
command/job:

I've already set up a scheduled backup job that dumps the contents of
my DB2 (ver 8.1) database to a folder on my hard drive nightly (it is
then backed up on a tape). However, I have no idea how to
automatically delete old backup dump files (I've been doing it
manually each morning). MS-SQL 2000 and 2005 are pretty
straightforward with their wizards, but I'm not seeing anything in
DB2. Where do I go?

Thanks!
John
Use the scheduler in your OS and remove backups older than ? days. If
you are on Unix/Linux, lookup crontab and find ( -ctime -name ). Not
sure about windows, but if not possible you can always use cygwin.

Another option is if you can manipulate the script that starts tha
backup to tape. After a successfull tapebackup, remove the backup.

/Lennart

Mar 6 '07 #2

P: n/a
"Lennart" <Er******************@gmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
Use the scheduler in your OS and remove backups older than ? days. If
you are on Unix/Linux, lookup crontab and find ( -ctime -name ). Not
sure about windows, but if not possible you can always use cygwin.

Another option is if you can manipulate the script that starts tha
backup to tape. After a successfull tapebackup, remove the backup.

/Lennart
It is somewhat dangerous to automatically remove backups older than n days
old, because if for some reason your backups have been failing for awhile,
you could end up with no backups. It would be better to remove old backups
past a certain date only if there are a certain number of backups already
existing in the directory.

Perhaps someone can volunteer a script that can do it (with both date and
number of backups as the criteria for deletes).
Mar 7 '07 #3

P: n/a
On 7 Mrz., 00:57, "Mark A" <nob...@nowhere.comwrote:
"Lennart" <Erik.Lennart.Jons...@gmail.comwrote in message

news:11**********************@s48g2000cws.googlegr oups.com...
Use the scheduler in your OS and remove backups older than ? days. If
you are on Unix/Linux, lookup crontab and find ( -ctime -name ). Not
sure about windows, but if not possible you can always use cygwin.
another option:
if you use "automatic maintenance" on the database db2 take's care of
it (backup up the db to a given directory and remove old backups)
control-center (right click on DB, --configure automatic
maintenance)

Mar 7 '07 #4

P: n/a
Your db cfg has a parm. NUM_DBBACKUPS=12 (default). This number tells DB2
to keep track of all backup images (12) in the Recovery History File (db2
List history BACKUP All, verify the command).
You can then use the DB2 PURGE command to tell DB2 to clean up older
references to the images. It does not clean them up.
You could then look at the history file and see what is the oldest image
tracked there and physically with a script remove, delete, purge, whatever
the older than that images.
If you read your docs. about that purge command and also use a db2exit or
logarchmeth parm., the purge will also clean up the logs associated with
those.

My db is: (NUM_DB_BACKUPS) = 3 and (REC_HIS_RETENTN) = 90
This means that the Rec. Hist File is self-pruning on the 90th day from
today and cleans the references, not the images, for all backups older than
90 days that are outside of the timestamp of the last 3 images.
Once in a while, I'll got to the backuo targets and physically remove the
older images. The db is not critical and this works for me but you can see
how easy it would be to tailor a script from there.
HTH, Pierre.
--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Lennart" <Er******************@gmail.coma écrit dans le message de news:
11**********************@s48g2000cws.googlegroups. com...
On Mar 6, 5:00 pm, snocone...@gmail.com wrote:
>Hi all,

This one's probably super easy and I'm just not finding the right
command/job:

I've already set up a scheduled backup job that dumps the contents of
my DB2 (ver 8.1) database to a folder on my hard drive nightly (it is
then backed up on a tape). However, I have no idea how to
automatically delete old backup dump files (I've been doing it
manually each morning). MS-SQL 2000 and 2005 are pretty
straightforward with their wizards, but I'm not seeing anything in
DB2. Where do I go?

Thanks!
John

Use the scheduler in your OS and remove backups older than ? days. If
you are on Unix/Linux, lookup crontab and find ( -ctime -name ). Not
sure about windows, but if not possible you can always use cygwin.

Another option is if you can manipulate the script that starts tha
backup to tape. After a successfull tapebackup, remove the backup.

/Lennart
Mar 7 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.