Poll: Which tool do you prefer for remotely copying files between #Linux , #FreeBSD , #macOS , or #Unix like systems? Please boost for reach. TIA.
ftp (secure version aka ftps)
3.1%
rsync
36.8%
scp
42.9%
sftp (openssh version)
17.1%
Poll ended at .
@nixCraft
rsync via ssh, specifically (:.
@nixCraft I use scp unless it’s a bunch of stuff, then rsync.
@dx
I struggled to respond for this very reason. I'm not going to rsync 1 or 2 files but I'm also not going to SCP a directory.
@nixCraft

@nixCraft

Exact directory copy:

wimlib-imagex --pipable --unix-data | ssh | ...

Accessing individual files:

sshfs (via sftp)

@nixCraft using sync for work stuff and falling in love quickly!

@nixCraft If I don't control either or both of the networks, scp.

If it's on a network I control, 'tar -cf - files |nc ip port' on the host that has the data and 'nc -l port |tar -xf -' on the host that wants the data.

@nixCraft for small, one-time transfers i usually just use scp because it's a little bit easier, but for anything remotely complex i use rsync.
@nixCraft scp has the most sane syntax, but has a complicated protocol

@nixCraft rsync because you can use it over ssh .
Local to Remote: rsync [OPTION]... -e ssh [SRC]... [USER@]HOST:DEST
Remote to Local: rsync [OPTION]... -e ssh [USER@]HOST:SRC... [DEST]

So you get the power of rsync and the security of ssh.

@nixCraft

scp for individual files.

For directory trees I generally do some variant of *ssh remotehost "cd $basedir; tar cvfz . -" > remotehost_remotedir.tgz*

@nixCraft I use rsync over ssh for keeping directories in sync. I use scp when I need to get or put a file or a directory and I'm not syncing things...
@nixCraft this depends on the situation, if I'm manually trying to copy files between hosts, I prefer scp but if I'm scripting it for automation, rsync all the way.
@nixCraft scp for a single file, rsync for a bunch.
@nixCraft @darkuncle specifically, rsync over ssh
@nixCraft scp for simplicity, rsync for reliability (usually after scp failed the first time).
@nixCraft “It depends.” `scp` is great for single files and one-time actions. `rsync` for deep copies, keeping the tree of files in sync, etc. And sneakernet if it’s quite a lot of terabytes.
@nixCraft
Rsync for many files or files copied often enough to write a script. Becaus rsync command line args are way too complicated. Scp or sftp when the number of files is too small to bother re-reading the rsync manual for the 273rd time.

@nixCraft @patrick told me about cpdup and that is a great tool!

https://github.com/DragonFlyBSD/cpdup

GitHub - DragonFlyBSD/cpdup: Filesystem mirroring utility from DragonFly BSD

Filesystem mirroring utility from DragonFly BSD. Contribute to DragonFlyBSD/cpdup development by creating an account on GitHub.

GitHub
@nixCraft hummm...I use 3 of them. ftps eventual. I think the usual software copy remotly.
@nixCraft i use 1200 baud modems
@nixCraft sftp (if i want a gui i use it with filezilla)
@nixCraft
If it's automated rsync, manual sftp or scp, depending on whether I know the file path or need to search for the file first and whether the account is limited to sftp access only.
@nixCraft I use scp (which uses sftp) for small stuff, and rsync for bigger (does it also use scp/sftp?)
@nixCraft
It depends few files scp large hunks rsync
@nixCraft my instance of snapdrop
@nixCraft the NAS in-house / seafile if extern
@nixCraft scp for single files between boxes, rsync for backups and mirrors
@nixCraft But lately, it's been 'croc’.
@nixCraft python3 -m http.server ✌️
@nixCraft Since you said "files" I have to go with `rsync`. If you'd written "file" I'd have chosen `scp`. Also interesting to see that it's not universally known that `rsync` uses `ssh`, and your `ssh` config, by default.
@nixCraft it depends, but 90% of the time it ends up being `nc`. and when it's not, it's an http server and openbsd's `ftp` (which is an http client) or `wget` or `curl` on a linux-flavour
@nixCraft scp over ssh or rsync over ssh if I have to preserve rights and owner information

@nixCraft

The last three are all ssh variants, and you're missing other options like https or magic wormhole that give more diversity. (And yes, technically ftps and https are both TLS.)

#Linux #FreeBSD #macOS #Unix

@encthenet @nixCraft scp is also really garbage (at the protocol level) for many small files. OpenSSH in the past couple years switched `scp` to using SFTP under the hood but I'm still in the habit of doing `tar c ... | xz | ssh some-server unxz \| tar x`
@strugee
Iirc, xz has an option to both parallelize it's work, but also to adjust how much compression to use based upon the speed of the link, which makes it a good choice, just don't forget to make sure ssh's compression is off.
@nixCraft
@nixCraft I did vote, but please know that I usually get my butler to perform tasks such as these.
@nixCraft You miss one option: It depends.