Suppose I want to rsync file foo.txt
on my local machine to file /home/me/somedirectory/bar.txt
on a remote computer, and that somedirectory/
doesn't yet exist. How do I do this?
I tried rsync -e ssh -z foo.txt remotemachine:/home/me/somedirectory/bar.txt
, but I get a rsync: push_dir#3 "/home/me/somedirectory" failed: No such file or directory (2)
error.
(Copying the file without renaming it works, though. That is, this runs fine: rsync -e ssh -z foo.txt remotemachine:/home/me/somedirectory/`)