Sync Remote Directories
Use rsync on the command line:
$ rsync -av -e "ssh -p [NON_DEFAULT_SSH_PORT]" [USER]@[REMOTE_ADDRESS]:/path/to/remote/dir/ /path/to/local/dir
aflag: Stands for "archive" and copies recursively, preserving permissions, symbolic links, etc.nflag: "Dry run" option for testing purposes.vflag: Verbose.eflag: Method for using a non-standard ssh port if the remote host is configured with a non-standard ssh port.
The order of remote vs local paths matters. Local path must be on the left in order push files on local to remote. Similarly, remote must be on the left to push files onto local.
--excludespecifies one subdirectory to exclude from the operation. The directory name must be followed with at trailing slash.--deleteoption will cause target files and directories to be deleted if they are not found within the source directory.
Home directory on remote can be specified with ~ after the semicolon, e.g. [USER]@[REMOTE_ADDR]:~/path/below/home/