Sync Remote Directories: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "Use `rsync` on the command line: <pre> $ rsync -av -e "ssh -p [NON_DEFAULT_SSH_PORT]" [USER]@[REMOTE_ADDRESS]:/path/to/remote/dir/ /path/to/local/dir </pre> * `a` flag: Stan...")
 
No edit summary
Line 11: Line 11:


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.
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.
Home directory on remote can be specified with `~` after the semicolon, e.g. `[USER]@[REMOTE_ADDR]:~/path/below/home/`

Revision as of 14:46, 11 September 2021

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
  • a flag: Stands for "archive" and copies recursively, preserving permissions, symbolic links, etc.
  • n flag: "Dry run" option for testing purposes.
  • v flag: Verbose.
  • e flag: 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.

Home directory on remote can be specified with ~ after the semicolon, e.g. [USER]@[REMOTE_ADDR]:~/path/below/home/