From 82a5c55d5cb8c7f3d5df2f7bbf37cb2780b919c7 Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Tue, 5 Apr 2011 11:50:05 +0000
Subject: [PATCH] [LMS-2180] added --checksum to rsync archiver (paranoia check
 for highest reliability)

SVN: 20654
---
 .../plugins/standard/RsyncArchiveCopierFactory.java   | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncArchiveCopierFactory.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncArchiveCopierFactory.java
index a0898ecf996..7b08fa09aec 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncArchiveCopierFactory.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncArchiveCopierFactory.java
@@ -26,8 +26,12 @@ import ch.systemsx.cisd.common.filesystem.rsync.RsyncCopier;
  * {@link IPathCopierFactory} that is more reliable than {@link RsyncCopierFactory} when it comes to
  * deciding which files to transfer. {@link IPathCopier} created by {@link RsyncCopierFactory} uses
  * "--append" flag causing files that are bigger in destination than in source to be ignored.
- * {@link IPathCopier} created by this factory is supposed to ignore only those files that have same
- * sizes and modification times.
+ * <p>
+ * {@link IPathCopier} created by this factory will compare a checksum on files to make a decision
+ * if the files have been changed and are in need of a transfer. The performance of such a check is
+ * much slower then the default one but with archiving we are concerned mostly about reliability.
+ * 
+ * @author Piotr Buczek
  */
 public final class RsyncArchiveCopierFactory implements Serializable, IPathCopierFactory
 {
@@ -35,8 +39,7 @@ public final class RsyncArchiveCopierFactory implements Serializable, IPathCopie
 
     public IPathCopier create(File rsyncExecutable, File sshExecutableOrNull)
     {
-        // TODO 2011-04-05, Piotr Buczek: should we use --no-whole-file?
         return new RsyncCopier(rsyncExecutable, sshExecutableOrNull, "--archive", "--delete",
-                "--inplace");
+                "--inplace", "--checksum");
     }
 }
\ No newline at end of file
-- 
GitLab