LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-15-2011, 04:16 PM   #1
wjtaylor
Member
 
Registered: Feb 2009
Posts: 78

Rep: Reputation: 15
how do i verify rsync


I've been playing with rsync. I've copied some data from one drive to another, I don't see any errors, but when I inspect with du -s I get two different values

root@T/home/user/Desktop# du -s backups
759421964 backups
root@T:/home/user/Desktop# du -s /data/tmp.moved/
759568528 /data/tmp.moved/
root@T:/home/user/Desktop#

How can I see what's different? I've been playing with diff and find/ls, but it's not as nice/complete as I'd like.

I did the following as root:

cd sourcedir
ls -aR > ~user/original
cd backupdir
ls -aR > ~user/backup
cd ~user
diff -yW 200 original backup > diff.txt

grep \> diff.txt
grep \< diff.txt
grep \| diff.txt

all came back null

Doing the above with ls -laR got messy...

Note: the source is an XFS filesystem (on a RAID5 array, if that matters), the backup filesystem is an EXT4 filesystem.

Could the difference in size be due to the difference in filesystem architecture?

The original rsync command was:
rsync -aHvPh --delete /data/tmp.moved/ ~user/backups

hmm.... I just realized I left the trailing slash off the end of the backups directory... not sure if that would cause difference in disk usage, though... the diff of the ls -aR showed no differences.

Any ideas?

Thanks,
WT
 
Old 03-15-2011, 04:43 PM   #2
Omnicronos
Member
 
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40

Rep: Reputation: 12
Each file system will indeed allocate the data differently, most likely caused by how they handle journaling. Another potential cause is your source directories have expanded and retracted in size. They will still have space allocated in the directories for the deleted file names even if the directories are empty. Since rsync rebuilds the directories from scratch during the copying process, the new directories on the target no longer have that space allocated for missing files.
 
Old 03-15-2011, 05:12 PM   #3
wjtaylor
Member
 
Registered: Feb 2009
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Omnicronos View Post
Each file system will indeed allocate the data differently, most likely caused by how they handle journaling. Another potential cause is your source directories have expanded and retracted in size. They will still have space allocated in the directories for the deleted file names even if the directories are empty. Since rsync rebuilds the directories from scratch during the copying process, the new directories on the target no longer have that space allocated for missing files.
So, would you say that the percentage difference in the disk usage is reasonable and not a concern given your above comment? Don't worry you're not liable.

WT

Last edited by wjtaylor; 03-16-2011 at 10:19 AM.
 
Old 03-15-2011, 05:23 PM   #4
Weird0ne
LQ Newbie
 
Registered: Nov 2009
Distribution: Slackware / Arch
Posts: 10

Rep: Reputation: 2
I agree with Omnicronos that it's most likely just the difference in filesystems. But if you wanted to be sure you could make a checksum before the transfer, and then verify against it afterwards.
 
Old 03-15-2011, 06:33 PM   #5
Omnicronos
Member
 
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40

Rep: Reputation: 12
Quote:
Originally Posted by wjtaylor View Post
So, would you say that the percentage difference in the disk usage is reasonable and not a concern given your above comment? Don't worry your not liable.

WT
No worries. I doubt you are experiencing any data loss. But, as Weird0ne wisely suggested, it never hurts to verify your data with a checksum.

Quote:
rsync --checksum: Normally rsync compares the timestamp and the size of a file to determine if it has changed since the last backup. If you use --checksum rsync will ignore the time stamps and checksum any files that are the same size to determine if they are different. Obviously this adds a significant slowdown to the backup process. You wouldn't normally use this option however it is good to have if you believe your backup data has become corrupted in a way that doesn't affect the information you see in an ls -l output.
http://www.sanitarium.net/golug/rsync_backups_2010.html
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync solaris + ld.so.1: rsync: fatal: libiconv.so.2: open failed: xxx_anuj_xxx Solaris / OpenSolaris 25 02-23-2012 03:23 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 09:48 AM
openssl ssl error code 14090086 verify the CA cert is ok / certificate verify failed acummings Slackware 14 02-27-2009 01:51 AM
How do you GPG verify all of your rsync slackware directory Old_Fogie Slackware 31 10-24-2006 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:55 PM.

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