This article covers the basics of rsync command, how to transfer and sync files locally as well as remotely. In fact, Rsync is the most efficient, accessible, and secure ways to sync files between operating systems and servers.
How to Install Rsync On Linux System ?
1. Install Rsync Alma Linux, Fedora, Rhel, Rocky Linux based distributions:
$ sudo yum install rsync -y
2. Install Rsync Debian, Linux Mint, Ubuntu based distributions:
$ sudo apt install rsync -y
Rysnc Commands includes:
- -a, –archive: archive files and directory while synchronizing ( -a equal to following options -rlptgoD)
- -b, –backup : take the backup during synchronization
- -l, –links: copy symlinks as symlinks during the sync
- -d, –delete: deletes extraneous files from the destination location.
- -e, –rsh=COMMAND: mention the remote shell to use in rsync
- -h, –human-readable: display the output numbers in a human-readable format
- -u, –update: don't copy the files from source to destination if destination files are newer
- -r, –recursive: sync files and directories recursively
- -n, –dry-run : perform a trial run without synchronization
- –p, –progress: show the sync progress during transfer
- -z, –compress: compress file data during the transfer
- -q, –quiet: suppress message output
- -v, –verbose : verbose output