Why is rsync skipping the main directory?

rsync -v -e ssh [email protected]:/Library/WebServer/sites/staging/app1/ ./export

You didn't give it any options to put it into recursive mode like -r or -a.

remote app1 directory is empty while local export directory has 4 sub directories and then a bunch of files in each of those

Do you have the options backwards here? The command should be rsync [source] [DESTINATION]. If the app1 directory is empty and you are trying to copy an empty directory then you aren't going to do anything useful.

Perhaps you need something like this instead?

rsync -avz ./export/  [email protected]:/Library/WebServer/sites/staging/app1/ 

Also:

  • You should almost always include a trailing slash on directories with rsync.
  • Almost every version of rsync released in the last 5-10 years defaults to using ssh has the remote transport. You probably don't have to specify the -e ssh.

Trying enabling rsync's built in ability to output a log file, by adding the following option to your command.

--log-file=/path/to/log.file

You can also increase the verbosity by adding an extra -v option, e.g. -avvz, according to the man page, 'Two -v options will give you information on what files are being skipped and slightly more information at the end.'

If this information that returns doesn't help identify the problem, please edit your question and add the additional output.