Gitlab Community Edition Instance

Commit 00ca0745 authored by bnachtw's avatar bnachtw
Browse files

all exit commands now with predefined return codes

parent 53232670
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
# 2019-08-19 0.6.4 added file:find:rule expression to omit symlinks # 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 # 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 # Thanks to Salvatore again for this fix
# 2019-11-26 0.6.5.1 added some return codes
# #
# important notes # important notes
# #
...@@ -94,6 +95,9 @@ use constant THREADFAILMAX => 10; # max number of attemps to start a new thre ...@@ -94,6 +95,9 @@ use constant THREADFAILMAX => 10; # max number of attemps to start a new thre
use constant RETURNALLOKAY => 0; # use constant RETURNALLOKAY => 0; #
use constant RETURNWARNING => 4; # use constant RETURNWARNING => 4; #
use constant RETURNERROR => 12; # backup failed due to errors use constant RETURNERROR => 12; # backup failed due to errors
use constant RETURNNOARGS => 13; # no arguments given with call
use constant RETURNNOCFGFILE => 14; # no cfg file found
use constant RETURNPIDFOUND => 15; # stopped due to existing pid file
use constant RETURNNOTHREAD => 21; # cannot start new threads use constant RETURNNOTHREAD => 21; # cannot start new threads
my $date; # date for statistics file | localtime->strftime ('%F') does not work on windows my $date; # date for statistics file | localtime->strftime ('%F') does not work on windows
...@@ -210,7 +214,7 @@ if ( ( defined $ARGV[0]) and ( $ARGV[0] eq "--help" ) ) ...@@ -210,7 +214,7 @@ if ( ( defined $ARGV[0]) and ( $ARGV[0] eq "--help" ) )
printf "usage: perl -f dsmci.pl\n"; printf "usage: perl -f dsmci.pl\n";
printf "use file ./dsmci.cfg for further configuration!\n"; printf "use file ./dsmci.cfg for further configuration!\n";
printf "\n"; printf "\n";
exit; exit RETURNNOARGS;
} }
############################################################################## ##############################################################################
...@@ -279,7 +283,8 @@ if ( defined $CFGFILE ) ...@@ -279,7 +283,8 @@ if ( defined $CFGFILE )
} }
else else
{ {
die "cannot open cfg file"; warn "cannot open cfg file";
exit RETURNNOCFGFILE;
} }
close $CFGFILE; close $CFGFILE;
shift @startpaths; shift @startpaths;
...@@ -306,7 +311,7 @@ $globallog_filename = $$ . ".all.log"; ...@@ -306,7 +311,7 @@ $globallog_filename = $$ . ".all.log";
if ( -e $pidfile ) if ( -e $pidfile )
{ {
warn "Found PID file ($pidfile) ! script stopped!"; warn "Found PID file ($pidfile) ! script stopped!";
exit 15; exit RETURNPIDFOUND;
} }
else else
{ {
......
Supports Markdown
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