Close
Not a member yet?
Register now and get started.
Register for an account
Home
Hosting
Shared Hosting Plans
Ulimited Plan
Bussiness Plans
Dedicated Server
Virtual Private Server
VPBX Hosted Phone System
Professional Email Hosting
Domain
Register a domain name
Transfer a domain name
Manage my domains
Tips for registration
Frequently Asked Questions
Design
Website Design
Portfolio
Templates
Marketing
Online Marketing
Email Marketing
Google SEO
Organic SEO
Affordable Package
Guaranteed Package
Enterprise Package
DIY Package
About Us
About WebNova
Join our Nova Team
Privacy Policy
Terms of Services
Support
Knowledge Base
Download
Submit a ticket
Contact
Account
-- Entire Support Site --
Support Center
»
Knowledgebase
»
How to use rsync for transferring files under Linux or UNIX
How to use rsync for transferring files under Linux or UNIX
Article
How to use rsync for transferring files under Linux or UNIX
by Vivek Gite · 30 comments
How do you install and use rsync to synchronize files and directories from one location (or one server) to another location? - A common question asked by new sys admin.
rsync is a free software computer program for Unix and Linux like systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction.
So what is unique about rsync?
It can perform differential uploads and downloads (synchronization) of files across the network, transferring only data that has changed. The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network connection.
How do I install rsync?
Use any one of the following commands to install rsync.
If you are using Debian or Ubuntu Linux, type the following command
# apt-get install rsync
OR
$ sudo apt-get install rsync
If you are using Red Hat Enterprise Linux (RHEL), type the following command
# up2date rsync
If you are using CentOS/Fedora Core Linux, type the following command
# yum install rsync
Always use rsync over ssh
Since rsync does not provide any security while transferring data it is recommended that you use rsync over ssh . This allows a secure remote connection. Now let us see some examples of rsync.
rsync command common options
* --delete : delete files that don't exist on sender (system)
* -v : Verbose (try -vv for more detailed information)
* -e "ssh options" : specify the ssh as remote shell
* -a : archive mode
* -r : recurse into directories
* -z : compress file data
Task : Copy file from a local computer to a remote server
Copy file from /www/backup.tar.gz to a remote server called openbsd.nixcraft.in
$ rsync -v -e ssh /www/backup.tar.gz
jerry@openbsd.nixcraft.in
:~Output:
Password:
sent 19099 bytes received 36 bytes 1093.43 bytes/sec
total size is 19014 speedup is 0.99
Please note that symbol ~ indicate the users home directory (/home/jerry).
Task : Copy file from a remote server to a local computer
Copy file /home/jerry/webroot.txt from a remote server openbsd.nixcraft.in to a local computer /tmp directory:
$ rsync -v -e ssh
jerry@openbsd.nixcraft.in
:~/webroot.txt /tmp
Password
Task: Synchronize a local directory with a remote directory
$ rsync -r -a -v -e "ssh -l jerry" --delete openbsd.nixcraft.in:/webroot/ /local/webroot
Task: Synchronize a remote directory with a local directory
$ rsync -r -a -v -e "ssh -l jerry" --delete /local/webroot openbsd.nixcraft.in:/webroot
Task: Synchronize a local directory with a remote rsync server
$ rsync -r -a -v --delete
rsync://rsync.nixcraft.in/cvs
/home/cvs
Task: Mirror a directory between my "old" and "new" web server/ftp
You can mirror a directory between my "old" (my.old.server.com) and "new" web server with the command (assuming that ssh keys are set for password less authentication)
$ rsync -zavrR --delete --links --rsh="ssh -l vivek" my.old.server.com:/home/lighttpd /home/lighttpd
Read related previous articles
* How do I sync data between two Load balanced Linux/UNIX servers?
* How do I sync data between two Load balanced Windows 2003 servers?
Other options - rdiff and rdiff-backup
There also exists a utility called rdiff, which uses the rsync algorithm to generate delta files Using rdiff. A utility called rdiff-backup has been created which is capable of maintaining a backup mirror of a file or directory over the network, on another server. rdiff-backup stores incremental rdiff deltas with the backup, with which it is possible to recreate any backup point. Next time I will write about these Utilities :)
rsync for Windows server/XP
Please note if you are using Windows, try any one of the program:
1. DeltaCopy
2. NasBackup
Further readings
=> Read rsync man page
=> Official rsync documentation
REF:http://www.cyberciti.biz/faq/transfer-files-from-unix-server/
Article Details
Article ID:
375
Created On:
15 Jul 2010 5:23 PM
This answer was helpful
This answer was not helpful
User Comments
Add a Comment
Sharing is good. If you have a comment about this entry, please feel free to share. The comments might be reviewed by our staff, and may require approval before being posted. Questions posted will not be answered. Please submit a Ticket for support requests.
Image Verification Required
Please enter the characters that appear to the right in the space provided. This is just to verify that you are a human.
Full Name:
E-mail Address: (optional)
Comment:
Login
[Lost Password]
E-mail:
Password:
Remember Me:
Search
-- Entire Support Site --
Knowledgebase
Downloads
Troubleshooter
Article Options
Add Comment
Print Article
PDF Version
E-mail Article
Add to Favorites
Hosting
Shared Hosting Plans
Dedicated Server
Virtual Private Server
VPBX Hosted Phone System
Professional Email Hosting
Domain
Register a domain name
Transfer a domain name
Manage my domains
Tips for registration
Frequently Asked Questions
Design
Website Design
Portfolio
Templates
Marketing
Online Marketing
Email Marketing
SEO Marketing
About Us
About WebNova
Join our Nova Team
Privacy Policy
Terms of Services
Copyright © 2010 -
WebNova Multimedia Pty Ltd
- All rights reserved. Conforms to W3C Standard
XHTML
&
CSS