•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Rsync over SSH

  • Home
  • Client
  • Qa Forum
  • Rsync over SSH

Posted By: Claudiu | 1 Replies | Last Reply On: Jan 03, 2018 00:40:56

How to rsync over ssh? 

Psychz - Nikhil

Votes: 0Posted On: Jan 03, 2018 00:40:56
 

Rsync command is used to synchronize files between two directories between a local and a remote server. This can be used to backup files to a remote server. In case the local server crashes, your data is secured to a remote server that can be retrieved. Rsync comes with different variations with which you can sync files by as per your requirement.

There are generally two types of operations that can be performed using rsync. These are called Push and Pull operation. Copying of files from local to a remote server is called a "push" operation. Whereas, Copying of files from remote to local machine is called a pull operation.

Thera are some basic conditions that should be fulfilled before using the rsync command.


Prerequisites

1. "rsync" should be installed on your system. To check if rsync is installed, run the following command.

   rsync --version

 

2. If the rsync command is not installed, install it by running the following command.

           RPM based Operating Systems - yum -y install rsync
           Debian/Ubuntu - apt-get install rsync 

3. Make sure that the IP is whitelisted on the firewall of both the remote and local system.

4. An established SSH connection between remote and local machine.

There are certain variations that can be used with the rsync command.

 

Copying files at a certain speed

You can specify the bandwidth limit in the rsync command to limit the transfer speed.

rsync -apW --bwlimit=xxxx /home/file/* root@x.x.x.x.:/home/file

(Note: Substitute the bandwidth in place of xxxx)

 

Displaying the progress of the operation

The "--progress" option displays the progress while the files are being transferred.

rsync -pavW --progress /home/file/* root@x.x.x.x.:/home/file

 

Slow network connections

For slow network connections, please use the following command as the "-z" option is used for file compression.

rsync -pavz --progress /home/file/* root@x.x.x.x.:/home/file

 

Sending files to remote machines with a different ssh port.

Sometimes the ssh port on the remote server is different from port 22 which is the default ssh port. In such a case, use the following command.

rsync -pavW --progress --inplace --rsh='ssh -p 2244' file/*  root@x.x.x.x:/file

 

The options used above perform the various functions.

# "-a" option is the same as -rlptgoD. Here are some of the functions that "-a" option performs.

1.Descend recursively into all directories (-r),
2.copy symlinks as symlinks (-l),
3.Preserve file permissions (-p),
4.Preserve modification times (-t),
5.Preserve groups (-g),
6.Preserve file ownership (-o), and
7.preserve devices as devices (-D).

# "-z" option is used to compress files while sending them.

# "-P" option is the same as --partial and --progress. 
   
   --partial - It is used to resume the interrupted transfers.
   --progress - It is used to display the progress bar of the transfers.

# "-v" - It is used to display the result in a more verbose manner.

The "rsync" command comes with numerous options. It is recommended to use the "man" command with rsync to master all the options. 

Was this reply helpful?

Related topics

  • How to rsync two directories
  • How to generate SSH Keys on Linux?
  • sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux
  • sBlock - Backup on Debian, Ubuntu and Related OS
  • Top Five Open Source Backup Software for Linux
  • Rsync Two Directories
  • How to use rsync over SSH?
  • Unable to Access The Server Via SSH
  • SSH Reverse Tunnel
  • SSH File Transfer
  • SSH Agent Forwarding
  • What Scientific Linux is and its features
  • Scientific Linux and its features
  • "DDoS for hire" service Webstresser.org taken down by collaborative effort
  • History of Internet
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801