This article covers a few options of the RSYNC command along with a few examples that elaborated on the usage of this command. In fact, with rsync, you will be able to use this tool very efficiently for transferring data from one location to another.
What is the Rsync Command Syntax ?
The syntax for the rsync command changes depending on the usage of the tool. We will cover all the scenarios in the following examples. Rsync syntax in its most basic form looks like this:
$ rsync options SOURCE DESTINATION
Remote data transfers require you to specify a host's address, but more on that later.
What are Rsync Command Options ?
The rsync tool comes with many options. You can enter rsync in your terminal and get all the details. We will list some of the most common rsync options:
- -r Allows to sync data recursively but does not keep ownership for users and groups, permissions, timestamps, or symbolic links.
- -a The archive mode behaves like the recursive mode but keeps all file permissions, symbolic links, file ownership, etc.
- -z Used to compress data during transfers to save space.
- -b Performs a backup during data synchronization.
- -h Shows the numbers in the output in a human-readable format.
- -n Does a dry run. Used for testing before the actual synchronization takes place.
- -e Instructs the rsync to use the SSH protocol for remote transfers.
- -progress Displays the transfer progress during synchronization.
- -v Verbose output. Displays the details of the transfer.
- -q Used to suppress the output for the rsync command and options.