1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| use strict;
my $FicLog = "";
$FicLog = 'd:\partage\sauvegarde.log';
# Date et Heure du Jour
my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday) = localtime();
$mon++;
$year += 1900;
my $Date_W=sprintf("%02d/%02d/%04d",$day,$mon,$year);
if (!open(LOG, $FicLog)) {
print "ERREUR !!! IMPOSSIBLE D'OUVRIR LE FICHIER: $FicLog";
exit 2;
}
while (<LOG>) {
chomp;
if (/ERREUR/) {
print "$_";
exit 2;
} elsif (/SAUVEGARDE DU SERVEUR LXFAX131 - DATE : (...) (...) ([0-9])/) {
print "$1\n";
print "$2\n";
print "$3\n";
my $jour = $3;
# # Control de la date
# if ($jour ne $day) {
# print "LE FICHIER LOG A PLUS D'UN JOUR - VERIFIER LA TACHE PLANIFIE SUR LE SERVEUR";
# exit 2;
# }
} elsif (/>>>> COPIE DES FICHIERS DE LA BASE DE DONNES REUSSIE/) {
print "$_";
exit 0;
}
}
close (LOG);
print "PROBLEME SUR LA SAUVEGARDE DU SERVEUR LXFAX131";
exit 2; |
Partager