RSYNC - Transfer
Topic:
Parameter
-r: recursive sync-a:-rrecursive sync with permission, date, user, group and etc.
Options:
P: overview transfer progress and transferring partialv: verbose--force: force deletion of dirs even if not empty--delete: delete extraneous files from destination dirs--exclude=: exclude files to sync
to Remote device
-
sync entire directory to remote device
rsync -a <directory> <username>@<hostname>:<remote_path> -
sync files in directory to remote device (with backslash
/)rsync -a <directory>/ <username>@<hostname>:<remote_path>
to Local device
Similar as to Remote device, swap the position of path between local and remote directory.
-
sync entire directory to local device
rsync -a <username>@<hostname>:<remote_path> <directory> -
sync files in directory to local device (with backslash
/)rsync -a <username>@<hostname>:<remote_path>/ <directory>
Overview transfer information
-
Overview transferring partial and progress from local to remote device
rsync -avP <directory>/ <username>@<hostname>:<remote_path>
Delete source device non-exists directory on target device
-
Sync non-exists directory from local on remote device
rsync -a --force <directory>/ <username>@<hostname>:<remote_path>
Delete source device non-exists sources on target device
-
Sync all the sources from source (ex. Local) device to target (ex. Remote) device
rsync -a --delete <directory>/ <username>@<hostname>:<remote_path>