На тебе скрипт и не парься.
#!/usr/bin/perl
$|=1;
@URLs = ('http://updates1.kaspersky-labs.com/updates/',
'http://updates2.kaspersky-labs.com/updates/',
'http://updates3.kaspersky-labs.com/updates/',
'http://downloads1.kaspersky-labs.com/updates/',
'http://downloads2.kaspersky-labs.com/updates/',
'http://downloads-us1.kaspersky-labs.com/updates/');
$file = 'avp.klb';
foreach (@URLs) {
$URL=$_;
last if (!(system ("fetch", $_.$file)))
}
opendir (DIR, ".");
while (defined($file=readdir(DIR)))
{
next if (($file=~/.pl$/) or ($file=~/\.$/) or ($file=~/\.b$/) or ($file=~/\.klb$/));@files_old=(@files_old,$file, (-s $file));
}
open F, "avp.klb";
foreach (<F>)
{
next if ((substr($_,0,1)=~/\D/));
($name, $crc, $size, $date)=split (/,/,$_);
($num, $name)=split (/=/,$name);
if (($files_old[$i] eq $name) and ($files_old[$i+1] == $size))
{
$i=$i+2; next
};
@dl=(@dl, $name);
$i=$i+2;
};
$message="Updated AVP files:\n";
if (defined (@dl)) {
foreach (@dl) {
system ("fetch", $URL.$_);
$message.=$URL.$_."\n";
}
}
open (SENDMAIL, "|/usr/sbin/sendmail -t") || die "ERROR: Can not run sendmail";
print SENDMAIL "MIME-Version: 1.0\n";
print SENDMAIL "To: root\n";
print SENDMAIL "Subject: AVP updated\n\n";
print SENDMAIL $message . "\n";
close (SENDMAIL);
system ("chmod 644 avp.klb");
system ("chmod 644 avp.set");
system ("chmod 644 *.avc");