Commit a1585f87 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added squid spool to exclude list

Fixed bug reporting tar exit status
Use lchown not chown when chowing on restore
Don't chmod & utime for symlinks
Fixed UNKNOWN displaying in the logs insted of ERROR
parent 422ad8a4
...@@ -51,6 +51,7 @@ my @defaultDataExcl = ( ...@@ -51,6 +51,7 @@ my @defaultDataExcl = (
"/var/spool/mailman/retry", "/var/spool/mailman/retry",
"/var/spool/postfix/public", "/var/spool/postfix/public",
"/var/spool/postfix/private", "/var/spool/postfix/private",
"/var/spool/squid",
"/var/cache/yum" "/var/cache/yum"
); );
...@@ -812,7 +813,7 @@ sub backup ...@@ -812,7 +813,7 @@ sub backup
printLog(LOG_ERROR,"Failed to execute: $!\n"); printLog(LOG_ERROR,"Failed to execute: $!\n");
exit 1; exit 1;
} elsif ($? & 127) { } elsif ($? & 127) {
printLog(LOG_ERROR,"Child died with signal %d\n",($? & 127)); printLog(LOG_ERROR,"Child died with signal %s\n",($? & 127));
exit 1; exit 1;
} else { } else {
my $retcode = $? >> 8; my $retcode = $? >> 8;
...@@ -1185,10 +1186,15 @@ sub restore ...@@ -1185,10 +1186,15 @@ sub restore
# Full dirname # Full dirname
my $ffilename = "$dest/$path/$fname"; my $ffilename = "$dest/$path/$fname";
# Restore attribs # Restore for links and files
if (!chown($file->{'uid'},$file->{'gid'},$ffilename)) { if (!lchown($file->{'uid'},$file->{'gid'},$ffilename)) {
printLog(LOG_ERROR,"Failed to chown(".$file->{'uid'}.",".$file->{'gid'}.") '$ffilename': $!\n"); printLog(LOG_ERROR,"Failed to lchown(".$file->{'uid'}.",".$file->{'gid'}.") '$ffilename': $!\n");
} }
# Ignore links for the rest...
next if (S_ISLNK($file->{'mode'}));
# Restore mode & utime only for files
if (!chmod($file->{'mode'},$ffilename)) { if (!chmod($file->{'mode'},$ffilename)) {
printLog(LOG_ERROR,"Failed to chmod(".$file->{'mode'}.") '$ffilename': $!\n"); printLog(LOG_ERROR,"Failed to chmod(".$file->{'mode'}.") '$ffilename': $!\n");
} }
...@@ -1229,8 +1235,8 @@ sub printLog { ...@@ -1229,8 +1235,8 @@ sub printLog {
$levelTxt = "NOTICE"; $levelTxt = "NOTICE";
} elsif ($level == LOG_WARNING) { } elsif ($level == LOG_WARNING) {
$levelTxt = "WARNING"; $levelTxt = "WARNING";
} elsif ($level == LOG_DEBUG) { } elsif ($level == LOG_ERROR) {
$levelTxt = "DEBUG"; $levelTxt = "ERROR";
} }
# Check log level # Check log level
......
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