9 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
my $usage;
#my $limitlog = 1800000000;
my $limitlog = 100000;
my $workdir="/feste/Verzeichnis/Struktur";
chdir ("$workdir");
my @files=`find . -mtime 1 -type f|xargs ls -t`;
if (scalar(@files)!=0) {
for my $file (@files) {
#print "$file\n";
chomp $file;
my @node = stat("$workdir/$file");
#print $node[7],"\n";
if ($file=~/\blog/ && $file!~/\b.gz/ && $node[7]>$limitlog) {
$version = $version+1;
$usage = "gzip -c $workdir/$file > /feste/Verzeichnis/Struktur/$file"."_#$version.gz";
#system ("$usage");
print $usage,"\n";
$usage = "cp /dev/null $workdir/$file";
#system ("$usage");
print $usage;
}
}
}
Use of uninitialized value in addition (+) at ./my_program line 20.
1
2
3
4
5
6
7
8
9
10
11
12
my $file = 'gezippte_datei_Datum_#3.log';
my ($nr) = $file =~ m!#(\d+)\.log!;
while(1){
unless(-e $file){
last;
}
else{
++$nr;
my $file = 'gezippte_Datei_Datum#'.$nr.'.log';
}
}
1
2
3
4
5
6
7
if ($file =~ m/#(\d+)\.gz/) {
$version = $1 + 1;
}
else
{
$version = $version+1;
}
9 Einträge, 1 Seite |