How to transfer files with SFTP between local folders/drives?

0

1

A bit of a noob question, so I apologize if this isn’t even doable, but I thought I’d ask.

I have two hard drives connected to my computer (Windows 8.1), one internal, one external (connected via USB). Let’s call them drives A:\ and Z:\, respectively. On each drive is a folder that I’d like to synchronize with the equivalent folder on the other drive. I would like to do this via sFTP, as follows:

A:\Folder1 <== sFTP ==> Z:\Folder2

In my sFTP client (FreeFileSync), I’m asked for a server name/IP address and such. I have no idea what to type into those fields.

Is this possible? And if so, how to do it? Please keep in mind that I’m a layman who’s never used (s)FTP and knows little about it, other than that I need to use it for this.

Any thoughts would be appreciated. Thanks.

Walter

Posted 2017-05-27T10:36:11.727

Reputation: 113

Why don't you just copy the files then delete NTFS Alternate Data Streams? there's a lot in google about it. – Putnik – 2017-05-28T08:35:20.903

Thanks for the suggestion. The fact is I don’t know if I trust free or commercial utilities to find and delete all ADS – that’s why I was looking for a way to transfer files that’s outright incompatible with ADS in the first place. I’ll still look into it, though, in case I find something interesting. – Walter – 2017-05-28T19:24:44.460

Why don't you ask about copying files without ADS? This is XY problem.

– Martin Prikryl – 2017-05-29T08:02:04.443

I can Google “copy files without ADS” well enough; I asked about SFTP because I read a guide that mentioned that method, only I didn’t know how to make it work. I just want to know if what I’m thinking of (in the OP) is possible before I rule it out. – Walter – 2017-05-29T08:50:07.113

To make that working, you would have to install SSH server.

– Martin Prikryl – 2017-05-29T08:51:51.923

That’s what I’d gathered. Thanks for the link. – Walter – 2017-05-29T08:53:36.267

Answers

1

I'm interested in your thought process for requiring SFTP? SFTP provides encrypted file transfer between two machines across a (possibly virtual) network connection. For this, you'll need an SFTP client (which it sounds like you have already) and an SFTP server, which it sounds like you might not.

If you're copying files on the same machine, it makes no sense to use this protocol; after all, the files you're copying won't be seen outside the machine, so the encryption and network transfer functions of SFTP would be moot.

I would use robocopy to mirror the two drives; e.g. to ensure that Z:\Folder1 is identical to A:\Folder2:

robocopy /mir A:\Folder1 Z:\Folder2

If you are likely to make changes to A:\Folder1 and Z:\Folder2 independently, say modifying A:\Folder1\fileA and Z:\Folder2\fileB, you can replace the /mir parameter with some of the other robocopy parameters to just copy newer files, and run it once in each direction to ensure that all changes are replicated.

I'll leave the latter as an exercise for you; you can always run robocopy /? to get the parameters used by robocopy.

Pak

Posted 2017-05-27T10:36:11.727

Reputation: 151

Thanks for the reply. The reason I want to use SFTP is because I heard it’s one of few ways to transfer/synchronize files whilst excluding NTFS alternate data streams, which I’m wary of. I know transferring to/from FAT-formatted drives also works, but some of the files are larger than 4 GB, so that’s no good. I know it’s a weird workaround; frankly I’m just curious to see if it can be done. – Walter – 2017-05-27T11:58:39.477

That's a use case I hadn't considered!

In that case, you will need to install an SFTP server and connect to localhost. You can also use a normal FTP server instead.

You might want to consider the Windows version of rsync (a Linux/Unix tool ported across) as a more lightweight version (it behaves similarly to robocopy insofar as it is a complete solution) but I haven't checked whether it ignores ADS or not. – Pak – 2017-05-27T12:32:54.397

0

What about tar-ing and untar-ing the files?

If you pipe the tar output directly to untar, you should get no overhead.


If you want to go the SFTP-way, you have to install SSH server on Windows. You can use Microsoft build of OpenSSH (link to my guide).

Martin Prikryl

Posted 2017-05-27T10:36:11.727

Reputation: 13 764

Thanks for replying, but I don’t know what “tar-ing”, “piping” and “overhead” are. (Edited to add: Google says you may be talking about something Linux-related. I know nothing about Linux; I’m on Windows. Sorry.) – Walter – 2017-05-29T08:48:41.817