In general, we can easily sync a remote directory using rsync.

Bash
$ rsync -avzh --progress --delete \
    name@remote_host:source_dir target_dir

This pulls a remote directory down to the local machine.

But here comes the question: when the port is not the standard 22, how should we pass the parameter? For example, sometimes we NAT to port 2222.

The answer is simple:

Bash
$ rsync -avzh --progress --delete  -e "ssh -p 2222" \
    name@remote_host:source_dir target_dir

Of course, rsync has many other powerful features; check the rsync man page for more.

Reference: Rsync with a non-standard ssh port