#!/usr/bin/perl #This is nothing special but it's the first real perl script I've done and I was interested #in hearing comments and opinions. Sorry if it's a little remedial for everybody but I #think it beats the hell out of a hello world. #This program deletes old unneeded backup logs with the goofy site dependent timestamp #backup.MMDDYY.log.Z $now=time; #WHATS THE CURRENT DATE/TIME $deldate=$now-2419200; #GO BACK 20 WORK DAYS ($seconds,$minutes,$hour,$monthday,$month,$year,$weekday,$yearday,$dst_flag)=localtime($deldate); $month+=1; #FORMAT MONTH $month*=10000; $monthday*=100; #FORMAT DATE $year-=100; #FORMAT YEAR $TS=$year+$month+$monthday; #FORMAT TIMESTAMP if ($TS < 100000) { $TS ="0$TS"; } $fullstamp="backup.$TS.log.Z"; unlink("/var/adm/$fullstamp"); #DELETE THE OLD LOGFILE