LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-22-2014, 01:14 AM   #1
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Rep: Reputation: 0
rsync change file size at destination


Hello,
i'm using rsync as backup solution,but at destination i see different size but number of file are the same .
by using
rsync -a --update --delete source destination
i saw folder size has increased but by using
rsync -az --update --delete source destination
i saw folder size at destination decreased
i use du -sh for folder size ....
any suggestion
best regards..
 
Old 01-22-2014, 03:02 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Rsync's -z option compresses the data during the transfer from source to destination, it does not influence the file size of the original and the backup.

The size of the directories itself might increase over time, this is a feature (or bug if you want) of the ext2/3/4 filesystem. If you remove files from a directory than the info stays present in the directories meta-data and as a result the directory itself seems to grow over time. The size increase is always a multitude of the block-size used on the system (4096 on most modern systems).

Also: The du command shows the file and/or directory size on a disk level (the amount of blocks it takes to store the info). This is not the same as the "actual" file size (amount of bits/bytes):
Code:
$ echo 1 > foo
$ ls -l foo 
-rw-r----- 1 druuna druuna 2 jan 22 09:59 foo
$ du -sh foo 
4.0K    foo
As you can see from the above foo is only 2 bytes, but it takes 4096 bytes (1 block) to store it on disk.
 
Old 01-22-2014, 11:28 PM   #3
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 199

Original Poster
Rep: Reputation: 0
Thanks druuna
I know about the difference of ls and du ... so i always use du for checking disk usage of a folder or fdisk -l .. for info i have 2 mail server one with 20G mbox and the other more than 70G .. after rsync i check disk usage ...different size i saw ..both source and destination have the file system ,block , cylinder and ... i can not explain this behavior for customers ..
rsync -a --update --delete /mbox/ mail2:/mbox

Best Regards
 
Old 01-23-2014, 03:06 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by hesisaboury View Post
so i always use du for checking disk usage of a folder or fdisk -l
I'm not sure why you would use fdisk -l, that command would show static information about the disk layout and would be useless to check space usage.

Quote:
for info i have 2 mail server one with 20G mbox and the other more than 70G
I'm assuming that these two are to be backed-up using rsync and that this is not the source and destination size. A 50G difference after running rsync would be rather odd.

Can you give an idea what the difference(s) are? Is the source side bigger or the destination side? How much of a difference is there?

Quote:
both source and destination have the file system ,block , cylinder and
The file-system and the block-size used can influence the size. It isn't clear from your answer if both sides are the same. Cylinders aren't important at all to determine file size and/or disk usage.

Quote:
after rsync i check disk usage ...different size i saw ..
Without any details and assuming that the output if the du command isn't misread we won't be able to give you any specific advise.

In general I would suggest that you:
- add the -v / --verbose flag to the rsync command(s) you use. Maybe the detailed info shows something interesting,
- recheck the content on both source and destination. Don't just run du, check if all the files are accounted for,
- make sure that the destination side isn't contaminated with other files and/or directories which where not part of the rsync process.
 
  


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
[SOLVED] File size increase after copy(scp,rsync) hesisaboury Linux - Networking 8 09-30-2013 08:04 AM
rsync Include/exclude based on pattern & file size? Geremia Linux - Software 1 01-20-2012 08:49 PM
Rsync set permissions destination Abstractt Linux - General 3 09-30-2010 02:05 AM
rsync results to a different file size? delltek04 Linux - Server 4 12-16-2009 01:04 PM
rsync file size issue? pratapsingh Linux - Server 4 10-29-2009 12:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:33 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