Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,24 @@ public Process sync(RemoteItem remoteItem, String localPath, String remotePath,
ArrayList<String> defaultParameter = new ArrayList<>(Arrays.asList("--transfers", "1", "--stats=1s", "--stats-log-level", "NOTICE", "--use-json-log"));
ArrayList<String> directionParameter = new ArrayList<>();

if(useMD5Sum){
boolean isSftpRemote = remoteItem.isRemoteType(RemoteItem.SFTP);
if(useMD5Sum && !isSftpRemote){
defaultParameter.add("--checksum");
}
if(isSftpRemote){
// Many SFTP servers (e.g. Synology restricted shells) can't run md5sum/sha1sum
// over SSH even though the files are reachable via SFTP. Disabling the remote
// hash commands avoids "corrupted on transfer: hashes differ" failures, but it
// also means no common hash type is left to compare with --checksum. If both
// were combined, rclone silently falls back to a size-only comparison and
// ignores modification time, so changed files of the same size never get
// re-synced. Skip --checksum here and let rclone use its default size+modtime
// comparison instead.
defaultParameter.add("--sftp-md5sum-command");
defaultParameter.add("none");
defaultParameter.add("--sftp-sha1sum-command");
defaultParameter.add("none");
}
if(deleteExcluded){
defaultParameter.add("--delete-excluded");
}
Expand Down