Larry,
Here is a perl script that I use at my site to get rid of old db tapes. We
do a db backup every day so the scripts deletes all but the last 7 days
backups. Hope this helps
Joel McCarty
#! /usr/bin/perl
use Time::Local;
# Convert current date to epoch seconds - subract interval (1 week) then
convert
# back to normal date
$interval = 604800;
$currdate = timelocal($sec, $min, $hours, (localtime)[3,4,5]);
$prevdate = $currdate - $interval;
($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday,
$isdst)
= localtime($prevdate);
$year += 1900;
$month += 1;
$month = sprintf("%.2d",$month);
$day_of_month = sprintf("%.2d",$day_of_month);
$prevdate="$month/$day_of_month/$year";
system("dsmadmc delete volh type=dbb todate=$prevdate > /tmp/rmvo
lhist");
system("mailx -s dcadsm-volhist\@hertz.com -r jmccarty\@hertz.com <
/tmp/rmvolhist 1>/dev/null");
Lawrence Clark <Larry_Clark AT THRUWAY.STATE.NY DOT US> on 02/02/2000 07:25:04
AM
Please respond to "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
To: ADSM-L AT VM.MARIST DOT EDU
cc: (bcc: Joel C McCarty/MIS/OKC/Hertz)
Subject: Volhist deletions
Hi:
I recently had to delete all references to ADSM database backups that were
backed up to a TYPE=FILE device class. Prior to deleting these entries,
ADSM would not allow the deletion of the device class.
While looking at the volhist entries I noticed they go back over a year. Is
there any purpose to keeping these entries, and is there a way to
automaticly trim the entries that are kept in the volhist file?
Larry Clark
NYS Thruway Authority
|