Rsync over SSH

Rsync over SSH


How To Use Rsync via SSH OR how to use RSync with a Remote System:
Syncing to a remote system is trivial if you have SSH access to the remote machine and rsync installed on both sides.

Once you have SSH access verified on between the two machines, you can sync the dir1 folder from earlier to a remote computer by using this syntax (note that we want to transfer the actual directory in this case, so we omit the trailing slash):

rsync -a ~/dir1 username@remote_host:destination_directory
This is called a "push" operation because it pushes a directory from the local system to a remote system.

The opposite operation is "pull". It is used to sync a remote directory to the local system. If the dir1 were on the remote system instead of our local system, the syntax would be:

rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine
Like "cp" and similar tools, the source is always the first argument, and the destination is always the second.

 
    • Related Articles

    • How to Set up SSH Keys

      About SSH Keys SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute ...
    • Setting up Sudo (Subusers) for SSH Access

      When setting up a new server and a client asks for SSH access, this is the process to add a subuser for SSH so that we don't have to give up the root password and risk getting it changed. 1. Edit /etc/sudoers (i.e. nano /etc/sudoers) 2. Insert ...
    • Using SSH Keys with Cartika IaaS/Cloud Service and VM's

      In order to enable SSH keys with 1 or more of your Cartika IaaS/Cloud Virtual Machines (VM's) Please do the following 1) Navigate to your respective IaaS service within your portal 2) On the SSH Keys screen, select "Register Key" 3) Paste the Public ...
    • How to import/export mysql via SSH commandline

      Managing Databases via Command Line (SSH) Using SSH can be a superior way to manage the files and databases on your account. Using a simple command you can import or export a MySQL database into an existing database on your account.   Please note ...
    • IpTables Essentials

      Introduction Iptables is the software firewall that is included with most Linux distributions by default. This cheat sheet-style guide provides a quick reference to iptables commands that will create firewall rules are useful in common, everyday ...