Gitlab Community Edition Instance

Commit e8e0194e authored by bnachtw's avatar bnachtw
Browse files

moved dev version to ordinary one

parent d7d57bb6
......@@ -48,6 +48,9 @@
# Thanks to Salvatore again for this fix
# 2019-07-17 0.6.3.2 fixed issue on trailing "*" on dsmc command line: last character is needed to keep trailing "/"
# renamed last relics of name "dsmcis" to "dsmci"
# 2019-08-19 0.6.4 added file:find:rule expression to omit symlinks
# 2019-11-20 0.6.5 added a patch collecting all error and warning lines and write to an errorlog file
# Thanks to Salvatore again for this fix
#
# important notes
#
......@@ -124,6 +127,8 @@ my $depth = ($maxdepth - 1); # just one level above $maxdepth, down to here al
my $cfgfilename = "dsmci.cfg"; # name of config file, should be located in current folder
my $log_filename; # filename for logging
my $err_filename; # filename for error logging
my @errorlines; # An Array holding all the logged warnings, errors and severe errors
my $errorlogfilename; # filename for collected error messages
my $globallog_filename; # filename for collected status logs
my @logfiles; # array for names of all logfiles
my $logfile; # name of single logfile
......@@ -333,12 +338,14 @@ foreach $actpath (@startpaths)
$rule->directory;
$rule->maxdepth($maxdepth);
$rule->mindepth($maxdepth);
$rule->not($rule->new->symlink);
my @tsuyd =$rule->in($actpath);
push @suyd, @tsuyd; # add to global list
$rule->directory;
$rule->maxdepth($depth);
$rule->mindepth(0);
$rule->not($rule->new->symlink);
my @tsund = $rule->in($actpath);
push @sund, @tsund; # add to global list
}
......@@ -429,14 +436,14 @@ while (my $line = <$GLOBALLOGFILE>)
if ( $line =~ /^ANS1228E/ or $line =~ /^ANS1802E/)
{;}
else
{ $errorcount++; }
{ $errorcount++; push @errorlines, $line; }
}
elsif ( $line =~ /^AN[RS][0-9]{4}W/ ) # Warnings
{ $warncount++; }
{ $warncount++; push @errorlines, $line; }
elsif ( $line =~ /^AN[RS][0-9]{4}S/ ) # Severe Errors
{ $sevecount++; }
if ( $line =~ /^ANS1329S/ ) # Server-out-of-Space Errors
{ $SooScount++; }
{ $SooScount++; push @errorlines, $line; }
#
# collect statistics of all jobs
#
......@@ -537,6 +544,18 @@ foreach $line (@sproflines)
close $PROFFILE;
###############################################################################
# write error info log
###############################################################################
$errorlogfilename = File::Spec->canonpath($date."-dsmci.errors.log");
open ERRORFILE, '>', $errorlogfilename or warn "Cannot open Error/Warning logfile: $errorlogfilename";
foreach $line (@errorlines)
{
print ERRORFILE $line;
}
close(ERRORFILE);
###############################################################################
###############################################################################
# summarize stats
......@@ -727,25 +746,25 @@ sub fork_backup_threads
$dir = File::Spec->canonpath("$actpath/#");
# cut off trailing "#", needed to preserver trailing "/" :-|
$dir =~ s{\#$}{};
# escape "$" if part of the name
$dir =~ s{\$}{\\\$}g;
$dir =~ s{\#$}{};
# escape "$" if part of the name
$dir =~ s{\$}{\\\$}g;
# backup commandline
$command = "\"$dsmcbin\" i \"$dir\" -optfile=\"$optfile\" -su=$switcher > $log_filename 2>&1";
$command = "\"$dsmcbin\" i \"$dir\" -optfile=\"$optfile\" -su=$switcher >> $log_filename 2>&1";
# record commandline in childlogfile
open CHILDLOGFILE, ">", $log_filename;
printf CHILDLOGFILE "CMD: >>%s<<\n\n", $command;
close CHILDLOGFILE;
open $CHILDLOGFILE, ">", $log_filename;
printf $CHILDLOGFILE "CMD: >>%s<<\n\n", $command;
close $CHILDLOGFILE;
# do backup and pipe output to childlogfile
$childreturnvalue = system($command);
# add returnvalue to logfile
open CHILDLOGFILE, ">>", $log_filename;
printf CHILDLOGFILE "\nRETURNVAL: %d\n", $childreturnvalue;
close CHILDLOGFILE;
# open $CHILDLOGFILE, ">>", $log_filename;
# printf $CHILDLOGFILE "\nRETURNVAL: %d\n", $childreturnvalue;
# close $CHILDLOGFILE;
# copy logfile to global log file
open $GLOBALLOGFILE, ">>", $globallog_filename;
......@@ -765,12 +784,14 @@ sub fork_backup_threads
}
}
close $CHILDLOGFILE;
# remove lock and clode global log file
flock ($GLOBALLOGFILE, LOCK_UN);
close $GLOBALLOGFILE;
printf $GLOBALLOGFILE "\nRETURNVAL: %d\n", $childreturnvalue;
# close global log file and remove lock
# flock ($GLOBALLOGFILE, LOCK_UN);
close $GLOBALLOGFILE; # also removes lock
# remove original child log file
unlink $log_filename;
# return rc and finish thread
exit $childreturnvalue;
}
}
......@@ -781,4 +802,4 @@ sub fork_backup_threads
redo; # jump back to loop head and do not step ahead
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment