Synchronizing folders between EC2 linux servers

About Rsync:

Rsync is a utility for efficiently transferring and synchronizing files across computer systems, by checking the timestamp and size of files.[3] It is commonly found on Unix-like systems and functions as both a file synchronization and file transfer program. The rsync algorithm is a type of delta encoding, and is used for minimizing network usage. Zlib may be used for additional data compression,[3] and SSH or stunnel can be used for data security.

Rsync is typically used for synchronizing files and directories between two different systems. For example, if the command rsync local-file user@remote-host:remote-file is run, rsync will use SSH to connect as user to remote-host.[4] Once connected, it will invoke the remote host’s rsync and then the two programs will determine what parts of the file need to be transferred over the connection.

Image for post
Image for post

Installing Rsync:

For Yum yum install rsync

For Debian / Ubuntu apt-get install rsync

Command:

Options:

-r, --recursive
-l, --links # copy symlinks as links
-p, --perms # preserve permissions
-t, --times # preserve times
-g, --group # preserve group
-o, --owner # preserve owner
-D # --devices --specials
--delete # Delete extra files
--exclude # Exclude log/tmp folders etc

A complete command would look like:

Written by

Product Lead at StegoSOC

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store