summaryrefslogtreecommitdiff
path: root/bin/bbackupquery
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bbackupquery')
-rw-r--r--bin/bbackupquery/BackupQueries.cpp17
-rw-r--r--bin/bbackupquery/BackupQueries.h1
-rw-r--r--bin/bbackupquery/documentation.txt1
3 files changed, 16 insertions, 3 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index 69c38a4c..1781282a 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -206,7 +206,7 @@ void BackupQueries::DoCommand(const char *Command, bool isFromCommandLine)
{ "sh", "" },
{ "getobject", "" },
{ "get", "i" },
- { "compare", "alcqE" },
+ { "compare", "alcqAE" },
{ "restore", "dri" },
{ "help", "" },
{ "usage", "" },
@@ -1050,6 +1050,7 @@ void BackupQueries::CommandGet(std::vector<std::string> args, const bool *opts)
BackupQueries::CompareParams::CompareParams()
: mQuickCompare(false),
mIgnoreExcludes(false),
+ mIgnoreAttributes(false),
mDifferences(0),
mDifferencesExplainedByModTime(0),
mExcludedDirs(0),
@@ -1112,6 +1113,7 @@ void BackupQueries::CommandCompare(const std::vector<std::string> &args, const b
BackupQueries::CompareParams params;
params.mQuickCompare = opts['q'];
params.mIgnoreExcludes = opts['E'];
+ params.mIgnoreAttributes = opts['A'];
// Try and work out the time before which all files should be on the server
{
@@ -1559,8 +1561,17 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
box_time_t fileModTime = 0;
localAttr.ReadAttributes(localPath.c_str(), false /* don't zero mod times */, &fileModTime);
modifiedAfterLastSync = (fileModTime > rParams.mLatestFileUploadTime);
- if(!localAttr.Compare(fileOnServerStream->GetAttributes(),
- true /* ignore attr mod time */,
+ bool ignoreAttrModTime = true;
+
+ #ifdef WIN32
+ // attr mod time is really
+ // creation time, so check it
+ ignoreAttrModTime = false;
+ #endif
+
+ if(!rParams.mIgnoreAttributes &&
+ !localAttr.Compare(fileOnServerStream->GetAttributes(),
+ ignoreAttrModTime,
fileOnServerStream->IsSymLink() /* ignore modification time if it's a symlink */))
{
printf("Local file '%s' "
diff --git a/bin/bbackupquery/BackupQueries.h b/bin/bbackupquery/BackupQueries.h
index 41e34d34..17043b61 100644
--- a/bin/bbackupquery/BackupQueries.h
+++ b/bin/bbackupquery/BackupQueries.h
@@ -68,6 +68,7 @@ private:
void DeleteExcludeLists();
bool mQuickCompare;
bool mIgnoreExcludes;
+ bool mIgnoreAttributes;
int mDifferences;
int mDifferencesExplainedByModTime;
int mExcludedDirs;
diff --git a/bin/bbackupquery/documentation.txt b/bin/bbackupquery/documentation.txt
index 429caabe..0fb0bacb 100644
--- a/bin/bbackupquery/documentation.txt
+++ b/bin/bbackupquery/documentation.txt
@@ -104,6 +104,7 @@ compare <store-dir-name> <local-dir-name>
-c -- set return code
-q -- quick compare. Only checks file contents against checksums,
doesn't do a full download
+ -A -- ignore attribute differences
-E -- ignore exclusion settings
Comparing with the root directory is an error, use -a option instead.