LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-23-2006, 06:53 AM   #1
V Naveen
LQ Newbie
 
Registered: Nov 2006
Posts: 18

Rep: Reputation: 0
Cool cp OR rsync


hello,

1) mount 10.5.5.100:/Backup /mount
cp -rup /home/leela /mount

2) mount 10.5.5.100:/Backup /mount
rsync -r /home/leela /mount


The first command works faster than the second according to my experience

But according to man pages of rsync the second command works much faster than first


So why is it like this?
 
Old 11-23-2006, 07:27 AM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Try:

Code:
rsync -avz /home/leela /mount
Let me know if it makes a difference?
 
Old 11-23-2006, 07:37 AM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
cp would copy every file every time..

rsync will scan all the files specified for changes, and after that is complete, it will transfer ONLY the changes in the files over the link to the destination.

So when keeping multiple machines in sync, especially when they are seperated by some sort of WAN connection the rsync method will definately take less time and less bandwidth.

When you are transfering between two folders on hard drives on the same machine the differences will not be as noticeable.
 
Old 11-23-2006, 09:24 PM   #4
V Naveen
LQ Newbie
 
Registered: Nov 2006
Posts: 18

Original Poster
Rep: Reputation: 0
Hi Farslayer

cp -rup command copies only updated files or it copies all files once again
 
Old 11-23-2006, 09:32 PM   #5
Sepero
Member
 
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Blog Entries: 1

Rep: Reputation: 33
When doing backups, you would only use "cp" if you didn't know how "rsync" works. I'm not 100% how rsync works myself, but I do know how to read manpages and create scripts. I use rsync in the ~/bin/backup.sh script I created. I don't really remember how it works, I just know it does the job.

(I would post the script, but I'm not at home right now.)
 
Old 11-23-2006, 09:33 PM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Using rsync locally for one file at a time doesn't make a lot of sense unless you have a large file whose contents change only in part between copies and you are copying to a device which can read fast, but has a very slow write speed. In this case, rsync is great

rsync is good locally for working out which files need to be copied in large trees of files, and only copying those which nee to be copied. It's at it's best working across a network (where the network is slower than the write speed of the target device), since it does a fairly efficient check of which files need updating, and only sends parts of files which are new (well, ok, it also sends some checking info as well...).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
Rsync sant25 Linux - General 2 09-02-2005 03:34 PM
rsync $@ya Linux - Software 1 06-06-2005 11:45 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Rsync buttersoft Linux - Software 4 11-05-2003 11:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration