tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"
Given that ssh it so ubiquitous I think this will always be my go to. tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"
Given that ssh it so ubiquitous I think this will always be my go to.On the receiving end:
nc -vll 0.0.0.0 12345 | pv | tar xv
On the sending end: tar cv files... | pv | nc -N "destination IP" 12345
pv is a nice tool that just reports on the rate and number of bytes moving through the pipe, optional if you don't have it. Throw in gpg --symmetric + gpg --decrypt for good measure if you want to encrypt it on the wire with a password. scp file.txt user@host:/dest/dir/rsync -zvh file.txt user@host:/dest/dir/
So many ways to do this :)
rsync -n -avh --progress source destination:~/asdf/ for a dry run followed by ctrl-p, ctrl-a, alt-f, alt-d, alt-d to remove the -n flag and then execute that for the real thing.
Occasionally though, I'll also use sftp if I'm just pulling one thing - perhaps even after sshing to the remote machine.
For all of these, SSH keys should be set up (and desktop logins secured) to make life easier.
As for Android, adb push and adb pull -a seems to work better than mtp:// or AirDroid in my experience.
rsync source destination will plonk the entire source directory and put it inside destination as a neat bundle.
rsync source/ destination will take the contents of source (but not the directory source itself) and plonk it in destination
I found the info page a little dry but it does describe it succintly:
rsync -av /src/foo /dest
rsync -av /src/foo/ /dest/foo
For some reason though, my head freaks out when it sees "foo" and "bar", but all they're saying is that it does the same thing.If in doubt though, just chuck everything into the destination ~/temp/ or ~/asdf/ and sort it out later.
To be honest though, most of the time I just use fish shell's autosuggestions to guide me along.
You should use '&&' instead of ';' on the host side. That way you don't accidentally dump your transfer contents into a wrong directory if the existing host dir doesn't exist.
e.g.: tar cf - stuff | ssh host "(cd /dest/dir && tar xf -)"
tar -C /dest/dir -xf - tar cf - src/ | ssh $host "tar -C /dest/dir -xf -"No encryption necessary No integrity checks No resume support Just plain and as fast it could get..
I need to try the netcat version but I'm hoping someone could show me a concurrent version of it that is mad fast.
< /path/to/source ncat remote-host 8001
On your destination machine: ncat -l 8001 > /path/to/dest
Though in most situations with files of reasonable size, you're probably going to be better off running through `gzip -c`.:-D
> tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"
:-O
-h for human-readable numbers -a for archive mode -v and --progress for verbose info -z for compression during transfer
Add a -n for a dry run if required.
https://linux.die.net/man/1/rsync
One of the people who came up with it - Andrew Tridgell - was more or less "responsible" for Linux and BitKeeper parting ways, which in turn ultimately lead to the creation of Git. I think it's a fascinating story. Excellent tools.
The progress / speed display is the main thing that keeps me coming back to rsync even though other tools might manage the same job - not seeing the progress of a copy is what had me searching for that solution in the very first place.
--info=progress2
You can use it since rsync version 3.1.0.
Didn't know about nc or rysnc at the time. Good to see those other solutions, and good that there are many ways to do it, with different pros and cons.
@{cd fromdir && tar cp .} | @{cd todir && tar xT}