The solution
TL;DR: Add the -r
flag for recursive.
This morning, before I got to drink my coffee, (and that explains it) I needed
to synchronize a directory between my notebook and my desktop. I thought of
Dropbox - that's exactly what I need. But since both are linux boxes, I was
sure there'd be a native alternative and, of course, there is: rsync
.
Now according to most examples in the manpages and tutorials on the net, I should run
notebook ><((("> rsync -az /my/local/dir/ workstation:/my/remote/dir
Notice 1) the trailing slash
on the local dir and the lack thereof on the remote one, and 2) the
workstation:
prefix I have configured in my ~/.ssh/config
for
tunneling through two ssh connections.
I do remember from checking the -a
flag that, amongst others, it does
preserve group and owner, which I don't want given that I have different users
on my laptop and workstation. So I just dropped it, and added -P
for a
progress meter:
notebook ><((("> rsync -Pz /my/local/dir/ workstation:/my/remote/dir
I was greeted by the following message and rsync returning with no error:
skipping directory .
Wow, what the heck!? Googling didn't lead any meaningful results either.
After a few minutes of wondering, I realized -a
also included the -r
flag,
for recursion. Not telling rsync
to recurse into directories and then giving
it only a directory to start with, it'll do nothing. Duh. So adding that flag
results in the final, working incantation:
notebook ><((("> rsync -rPz /my/local/dir/ workstation:/my/remote/dir
A more understandable message, like specifically calling out the directory I passed as an argument, would've been more helpful.
Have a nice day!