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 = (
"/var/spool/mailman/retry",
"/var/spool/postfix/public",
"/var/spool/postfix/private",
"/var/spool/squid",
"/var/cache/yum"
);
......@@ -812,7 +813,7 @@ sub backup
printLog(LOG_ERROR,"Failed to execute: $!\n");
exit 1;
} elsif ($? & 127) {
printLog(LOG_ERROR,"Child died with signal %d\n",($? & 127));
printLog(LOG_ERROR,"Child died with signal %s\n",($? & 127));
exit 1;
} else {
my $retcode = $? >> 8;
......@@ -1185,10 +1186,15 @@ sub restore
# Full dirname
my $ffilename = "$dest/$path/$fname";
# Restore attribs
if (!chown($file->{'uid'},$file->{'gid'},$ffilename)) {
printLog(LOG_ERROR,"Failed to chown(".$file->{'uid'}.",".$file->{'gid'}.") '$ffilename': $!\n");
# Restore for links and files
if (!lchown($file->{'uid'},$file->{'gid'},$ffilename)) {
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)) {
printLog(LOG_ERROR,"Failed to chmod(".$file->{'mode'}.") '$ffilename': $!\n");
}
......@@ -1229,8 +1235,8 @@ sub printLog {
$levelTxt = "NOTICE";
} elsif ($level == LOG_WARNING) {
$levelTxt = "WARNING";
} elsif ($level == LOG_DEBUG) {
$levelTxt = "DEBUG";
} elsif ($level == LOG_ERROR) {
$levelTxt = "ERROR";
}
# 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