rsync vs. async Uni-directional Example
The async and rsync command-line options are similar for basic uni-direction synchronization.
Below 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 time stamps 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 time stamps 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 HST Server or High-Speed Transfer Endpoint 3.1+) | Preserve modification times |
-o, --owner | -u, --preserve-uid | Preserve owner |
-g, --group | -j, --preserve-gid | Preserve group |
-p, --perms | With regard to directory attributes, if the source mode doesn't have sufficient owner permissions, then the destination will add: 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 Include and Exclude Filtering Rules. |
--exclude-from=file | -E, --exclude-from=file | Exclude filter (text file with paths for exclusions). See Include and Exclude Filtering Rules. |
--include=pattern | --include=pattern | Include paths that match pattern. See Include and Exclude Filtering Rules. |
--exclude=pattern | --exclude=pattern | Skip paths that match pattern. See Include and Exclude Filtering Rules. |
-c none | rsync, as a protocol, does not encrypt on its own; however, rsync can enable/disable the SSH encryption protocol (using option -e ssh). |