Commit 6668851d authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added a delay before termination of 2 seconds

This will help in future when we need to do cleanups
parent 1a3e5512
......@@ -1066,30 +1066,6 @@ sub backup
# If we backing up or restoring, we need to check the compression program
if (defined($optctl{'backup'}) || defined($optctl{'restore'})) {
# One last check for to make sure the compression program exists
if (checkPATH(my $compressProgram = "compress-".$config{'compress'})) {
print(STDERR "ERROR: Compression program '$compressProgram' cannot be found in path!");
exit 1;
}
}
# Check if we backing up
if (defined($optctl{'backup'})) {
backup($sourceDir,$destDir);
# Or restoring...
} elsif (defined($optctl{'restore'})) {
restore($sourceDir,$destDir);
} else {
print(STDERR "ERROR: No command given\n\n");
displayHelp();
exit 1;
}
# Restore function
sub restore
{
......@@ -1615,4 +1591,45 @@ sub checkPATH
}
# Function to handle SIGINT
sub sigINT_handler
{
print(STDERR "Caught SIGINT! ... terminating");
sleep(2);
exit 1;
}
# If we backing up or restoring, we need to check the compression program
if (defined($optctl{'backup'}) || defined($optctl{'restore'})) {
# One last check for to make sure the compression program exists
if (checkPATH(my $compressProgram = "compress-".$config{'compress'})) {
print(STDERR "ERROR: Compression program '$compressProgram' cannot be found in path!");
exit 1;
}
}
# Install our int handler
$SIG{INT} = \&sigINT_handler;
# Check if we backing up
if (defined($optctl{'backup'})) {
backup($sourceDir,$destDir);
# Or restoring...
} elsif (defined($optctl{'restore'})) {
restore($sourceDir,$destDir);
} else {
print(STDERR "ERROR: No command given\n\n");
displayHelp();
exit 1;
}
# vim: ts=4
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