Syncing large group of files to remote computer via SFTP

What is the problem you are having with rclone?

I am attempting to sync a large amount of files via SFTP from my Windows-based desktop computer to my Windows-based laptop. Before I do this, I want a little bit of clarity as to what exactly I am doing.

Because rsync doesn't have any windows binaries (and god forbid I install cygwin), the goal was to use rclone's sync function to make the files on my laptop up-to-date with the files on my desktop. To do this, I'm running rclone sync from my desktop.

The FTP wiki page says the following; "Sync /home/local/directory to the remote directory, deleting any excess files in the directory." The wordage is a bit vague with what exact "excess files" are going to be deleted. If its excess files on the laptop side, then its no big deal, I don't care about those; the goal is to get that folder up to date. I just care about losing files on the desktop side. So I'm making sure that no files on my desktop computer will be harmed.

This is probably really verbose but I wanted to be super clear on what I was trying to do and my concerns. Any help would be super helpful. Thanks everyone!

Run the command 'rclone version' and share the full output of the command.

PS C:\Users\Admin> rclone version
rclone v1.63.1
- os/version: Microsoft Windows 10 Enterprise LTSC 2021 21H2 (64 bit)
- os/kernel: 10.0.19044.3208 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

SFTP

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync --interactive D:/Files remote:D:/Files

The rclone config contents with secrets removed.

[laptop]
type = sftp
host = [ip to laptop]
user = Admin
pass = [password hash]
shell_type = powershell

A log from the command that you were trying to run with the -vv flag

N/A

welcome to the forum,

here are the docs for rclone sync

--dry-run flag should be your friend. You can also add -vv to see all details.

This is the best way to experiment.

Thanks guys... was able to sync most of what I needed to. I did encounter one problem; new files were able to sync correctly, but old files with changes were unable to sync. I was met with the following error for a large amount of files;

2023/09/09 13:52:33 ERROR : Eric B. & Rakim - (1992) Don't Sweat The Technique [CD-FLAC] {MCAD-10594 Silent Remaster}/02 Teach The Children.flac: Failed to calculate dst hash: failed to calculate md5 hash: failed to run "&{param($Path);Get-FileHash -Algorithm MD5 -LiteralPath $Path -ErrorAction Stop|Select-Object -First 1 -ExpandProperty Hash|ForEach-Object{\"$($_.ToLower()) ${Path}\"}} 'D:/Files/Music/Eric B. & Rakim - (1992) Don't Sweat The Technique [CD-FLAC] {MCAD-10594 Silent Remaster}/02 Teach The Children.flac'": The string is missing the terminator: '.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString: Process exited with status 1

I'll admit I'm not super versed with powershell, so I don't know entirely whats going on here, but I think it might have something to do with the file paths having spaces or something similar.

Also encountered a SSH_FX_BAD_MSESAGE error; I don't have logs on hand for this one, so I will report back when I do another sync.

Good that you see some progress but... what is the reason to use SFTP and rclone to sync files between two Windows computers?

SFTP is not native Windows protocol so you have to run some 3rd party SFTP server etc. Especially you admit you are not very familiar with more complex things on this platform.

Why not to make it simple and just share folder from one computer using SMB? And then copy things without rclone - just use explorer...

To be fair, it's a matter of starting a local ssh server via the included Windows OpenSSH binary, not exactly complex to whip up. Samba would be a problem because neither computer is online 24/7, and to my knowledge (which admittedly isn't much) I don't think samba has the functionality that this program has. I chose rclone because I needed a program similar to rsync and this seemed to be the best way to do what I want, even if its seemingly focused around syncing a local fs with a cloud fs. I'll do some further analysis to see what my options are.

FYI - for similar problem I use program called syncthing. I've been using it for years and works perfectly to keep different computers folders in sync

1 Like

Will check this out. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.