Rsync versus async uni-directional example
The async and rsync command line options are similar for basic uni-directional synchronization.
The are examples of rsync commands and their async equivalents for uni-directional synchronization.
Example 1
Options:
- Recursively synchronize the contents of a directory, /media/ to the remote system directory /backups/media.
- Preserve access and modification timestamps on files.
- Preserve the owner and group ID.
- No encryption.
- Transfer policy = fair.
- Target rate = 100,000 Kbps (100 Mbps).
- One-time transfer (not continuous).
rsync command:
# rsync --stats -v -r -u -l -t -o -g -p /media/ editor@docserver:/backups/media
async equivalent:
# async -N Oneway -u -t -j -d /media/ -r editor@docserver:/backups/media -l 100M -w d0c5 -K push -c none
Example 2
Options:
- Recursively synchronize the contents of the directory
/media/wmv/
- Exclude "
.
" files within the directory. - Exclude all other directories.
- Preserve the owner and group ID.
- Preserve access and modification timestamps on files.
- No encryption.
- Transfer policy = fair.
- Target rate = 100,000 Kbps (100 Mbps).
- One-time transfer (not continuous).
rsync command:
# rsync --stats -v -r -u -l -t -o -g -p /media/ --include="/media" --include="/media/wmv" --exclude="/media/.*" editor@docserver:/backups/media
async equivalent:
# async -N Oneway -u -t -j -d /media/ --include="/media" --include="/media/wmv" --exclude="/media/.*" -r editor@docserver:/backups/media -w d0c5 -K push -c none
Options comparison table
rsync Option | async Option | Description |
---|---|---|
--stats |
Enabled by default | Display file transfer status. |
-v, --verbose |
Enabled by default | Increase verbosity. |
-q, --quiet |
-q, --quiet |
Disable progress display. |
-r, --recursive |
Enabled by default | Recurse into directories. |
-u, --update |
If a file exists at the destination with the same name, then the default behavior is to do nothing if the files are the same (size and checksum), and overwrite if the file is different. | Skip files that are newer on the receiver. |
-l, --links |
Linux and macOS: -n copy ,
--symbolic-links=copy Symbolic links are skipped in Windows. |
Copy symbolic links as symbolic links (Linux and macOS only). |
-t, --times |
-t, --preserve-time (must have HSTS or High-Speed Transfer Endpoint) |
Preserve modification times. |
-o, --owner |
-u, --preserve-uid |
Preserve owner. |
-g, --group |
-j, --preserve-gid |
Preserve group. |
-p, --perms |
Regard the directory attributes, if the source mode doesn't have sufficient owner
permissions, then the destination adds: owner rwx . |
Preserve permissions. |
--version |
-A, --version |
Print version number. |
-h, --help |
-h, --help |
Show help. |
--include-from=file
|
-I, --include-from=file |
Include filter (text file with paths for inclusion). See Filtering patterns and examples . |
--exclude-from=file |
-E, --exclude-from=file |
Exclude filter (text file with paths for exclusions). See Filtering patterns and examples. |
--include=pattern |
--include=pattern |
Include paths that match pattern. See Filtering patterns and examples. |
--exclude=pattern |
--exclude=pattern |
Skip paths that match pattern. See Filtering patterns and examples. |
-c none |
rsync, as a protocol, does not encrypt on its own; however,
rsync can enable or disable the SSH encryption protocol (by using option
-e ssh ). |