3 ms·
Sftp is also not that great. To transfer a folder with children you have to create an empty folder of the same name on the server. Only then you can transfer th
by devwastaken 5y ago
Sftp is also not that great. To transfer a folder with children you have to create an empty folder of the same name on the server. Only then you can transfer the client folder, but it doesn't go into the server folder of the same name. Perhaps stack overflow was just entirely incorrect, but that's how I've had to do it with limited systems in the past.
- mzs 5y ago$ tar cf - foo bar | ssh user@host tar -C baz -xvf -
- chasil 5y agoThat can bite you if the remote tar allows absolute paths.
- loxias 5y agohigh five It truly is the best, no? My pipelines look a bit different than yours (they usually have `lzop`/`zstd`, `cd`, and occasionally `pv`), but tar truly is the best file copy utility. I rarely use `cp -a` even when copying locally. `tar` is so much faster.
- technofiend 5y agoI use this locally as well, simply because I know and prefer tar's behavior to that of cp. For example tar cf - . | (cd /some/where/else; tar xvf -). It's possible to do this using cpio as well but it always seemed like cpio needed so many more switches to do the same thing.
- xioxox 5y agoYou can also use lftp to transfer a directory tree using the sftp protocol: $ lftp sftp://hostname lftp ~> cd somedir lftp ~> mirror . lftp ~> quit