summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/bbackupquery/BackupQueries.cpp29
-rw-r--r--bin/bbackupquery/BackupQueries.h1
2 files changed, 26 insertions, 4 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index d491fac6..1726b960 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -1054,6 +1054,7 @@ BackupQueries::CompareParams::CompareParams()
mIgnoreAttributes(false),
mDifferences(0),
mDifferencesExplainedByModTime(0),
+ mUncheckedFiles(0),
mExcludedDirs(0),
mExcludedFiles(0),
mpExcludeFiles(0),
@@ -1177,13 +1178,29 @@ void BackupQueries::CommandCompare(const std::vector<std::string> &args, const b
return;
}
- printf("\n[ %d (of %d) differences probably due to file modifications after the last upload ]\nDifferences: %d (%d dirs excluded, %d files excluded)\n",
- params.mDifferencesExplainedByModTime, params.mDifferences, params.mDifferences, params.mExcludedDirs, params.mExcludedFiles);
+ printf("\n[ %d (of %d) differences probably due to file "
+ "modifications after the last upload ]\n"
+ "Differences: %d (%d dirs excluded, %d files excluded, "
+ "%d files not checked)\n",
+ params.mDifferencesExplainedByModTime, params.mDifferences,
+ params.mDifferences, params.mExcludedDirs,
+ params.mExcludedFiles, params.mUncheckedFiles);
// Set return code?
if(opts['c'])
{
- SetReturnCode((params.mDifferences == 0)?COMPARE_RETURN_SAME:COMPARE_RETURN_DIFFERENT);
+ if (params.mUncheckedFiles != 0)
+ {
+ SetReturnCode(COMPARE_RETURN_ERROR);
+ }
+ else if (params.mDifferences != 0)
+ {
+ SetReturnCode(COMPARE_RETURN_DIFFERENT);
+ }
+ else
+ {
+ SetReturnCode(COMPARE_RETURN_SAME);
+ }
}
}
@@ -1323,6 +1340,7 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
{
printf("ERROR: stat on local dir '%s'\n",
localDirDisplay.c_str());
+ rParams.mUncheckedFiles ++;
}
return;
}
@@ -1372,6 +1390,7 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
{
printf("ERROR: opendir on local dir '%s'\n",
localDirDisplay.c_str());
+ rParams.mUncheckedFiles ++;
return;
}
try
@@ -1668,10 +1687,12 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
e.GetType(),
e.GetSubType(),
storePathDisplay.c_str());
+ rParams.mUncheckedFiles ++;
}
catch(...)
- {
+ {
printf("ERROR: (unknown) during file fetch and comparison for '%s'\n", storePathDisplay.c_str());
+ rParams.mUncheckedFiles ++;
}
// Remove from set so that we know it's been compared
diff --git a/bin/bbackupquery/BackupQueries.h b/bin/bbackupquery/BackupQueries.h
index 17043b61..c9540110 100644
--- a/bin/bbackupquery/BackupQueries.h
+++ b/bin/bbackupquery/BackupQueries.h
@@ -71,6 +71,7 @@ private:
bool mIgnoreAttributes;
int mDifferences;
int mDifferencesExplainedByModTime;
+ int mUncheckedFiles;
int mExcludedDirs;
int mExcludedFiles;
const ExcludeList *mpExcludeFiles;