Update: Thanks for the replies. I should've done a bit of extra research about scp first. Guess this is an example of Cunningham's Law.
Update: Thanks for the replies. I should've done a bit of extra research about scp first. Guess this is an example of Cunningham's Law.
It isn't suited for millions of files, but neither is scp.
I think that's what a sibling is getting into with the "better to tar files and send them over ssh in some cases" thing. And yes, you can hack it in after-the-fact with xargs/etc but it's clunky compared to just having native multithreading like rclone/etc.
That being said, I hadn't heard of rclone - thanks for mentioning it, it looks amazing. I'll definitely be trying this out for my use cases...
[1] http://www.gnu.org/software/parallel/man.html#example-parall...
Today seeks are mostly instants, so maybe my experience isn't valid anymore.
Like everyone here I've no benchmarks but have got burned trying to rsync around too many small files.
rsync is time served. It just works. I'm sure there are other funky solutions but they are not proven over decades.
To transfer a set of files from local device to a remote device is as easy as:
tar -c path/to/file1 path/to/file2 ... | ssh user@hostname tar -x
The flags can be memorized with a mnemonic: -c = create (archive file)
-x = extract (archive file)There is wild variation in tar implementations beyond what is required by POSIX.
"-H pax" is also an important item to specify on the side creating the tar file, as pax support is much older than pax as a default, and the pre-pax default (gnu or USTAR?) has a short enough maximum path length as to have caused me problems in the past.
https://www.linode.com/docs/guides/copying-a-disk-image-over...
It's not enabled by default in some distributions and many "how to secure your server" guides recommend disabling it/keeping it disabled due to the best practice of only enabling necessary services.
This will break `scp` for many corporate cases (where arguing that sftp is necessary is an impossible fight)
Actually a more sane setup, which I've used, is only SFTP is enabled, no shells. You can fetch files, you can send files, but you can't... for example... run a race exploitation shell script to seize root permissions.
This also has the advantage that if we can only send and receive files, the "server" we're connecting to needn't really exist, like an HTTP virtual host it's just a bunch of "files" and could actually be backed by a database with some blob tables.
There's a lot of scp usage in a typical corporate environment that should actually be files living in a shared filestore anyway, I've seen way too many files which ought to actually be:
* A wiki entry
* Checked into a git repository
* Shared in some cloud service e.g. OneCloud
... but instead they live on Steve's F:\Documents and if Steve is off sick well, here's the copy I made last week, I hope it isn't missing any important updates and somebody make sure Steve gets this when we change it...
The file living in /usr/project/ on testserver03 instead of F:\Documents on Steve's laptop is not a real improvement.
Removing options from "corporate" users usually results in saner choices being made, because you stop being able to bikeshed the implementation details. People have a server and they need a way to transfer files. If you have two protocols that can be used, arbitrary decisions will be made. If the readily available tools all break, there is no more decision to be made – whatever needs to be enabled will be enabled.
Never underestimate the inertia of server configurations.
Too late:
https://en.wikipedia.org/wiki/Files_transferred_over_shell_p...
In KDE this is implemented as a standard protocol handler ("ioslave") and you can access it from most KDE apps using URLs like "fish://user@server/":
https://docs.kde.org/trunk5/en/kio-extras/kioslave5/fish/ind...
I've written a few custom ssh servers and you don't really need to do anything to them to support scp.
sftp uses the sftp subsystem. scp just uses regular ssh requests and transports data over the ssh channels.
SFTP also transports data over SSH channels.
TL;DR it's just the same command, mostly, for now.
As far as I remember, rsync does a few neat tricks like hashing files on both sides of a connection to determine whether it's worth transferring them over a potentially slow connection, which would not work with pure sftp.