search cancel

How to administer the number of SpectroSERVER database save files retained

book

Article ID: 255421

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

We are backing up the SpectroSERVER database once every day. We noticed in the $SPECROOT/SS-DB-Backup directory there are many database save files.

How can we configure it so that only the most recent 7 days of backup files are kept and anything older is automatically deleted?

Environment

Release : Any

Resolution

Whenever a Spectrum backup is run, the post_olb_script is also run.

By default, this script does not do anything but it is mainly used to backup the Archive Manager (DDM) database. Reference knowledge article How to backup the the Archive Manager (DDM) database

The post_olb_script can also be modified to examine the SpectroSERVER database backup files looking for files that are X days old or older and if found, to remove them.

For example, adding the following at the end of the post_olb_script before "exit $retval" will look for any SpectroSERVER database backup files that are 14 days or older and if found, will delete the file.

/usr/bin/find $backup_dir -mtime +14 -name "db_*SSdb.gz" -exec rm {} \;