Notices


Reply
Thread Tools
Community Council | Posts: 4,340 | Thanked: 10,718 times | Joined on May 2012 @ Southerrn Finland
#11
Originally Posted by knobtviker View Post
Just a question:
When you update an existing file, do you upload/download a whole file or just the part of the file that changed?
Well, that's up to the implementation of rsync on the platform.

As far as I know (and now checking from wikipedia confirms this) the linux rsync divides all files into fixed size blocks and only transmits the differing blocks based on checksumming algorithm. (source: http://en.wikipedia.org/wiki/Rsync, see the section "Determining which parts of a file have changed")

A short test of my own; I transferred a binary file of about 9MB with cloudsync.sh, then hexedited it so that I changed just one byte somewhere about middle of the file, and resent it.

Code:
Apr 29 08:25:50 (2013) cloudsync: Triggered upload from filesystem
Apr 29 08:25:50 (2013) cloudsync: Using WLAN connection to server
Apr 29 08:26:02 (2013) cloudsync: sending incremental file list ./ rsync-muutostesti  sent 9176267 bytes  received 34 bytes  734104.08 bytes/sec total size is 9175040  speedup is 1.00
Apr 29 08:26:02 (2013) cloudsync: Upload tranfer succeeded
Apr 29 08:26:54 (2013) cloudsync: Triggered upload from filesystem
Apr 29 08:26:54 (2013) cloudsync: Using WLAN connection to server
Apr 29 08:27:01 (2013) cloudsync: sending incremental file list ./ rsync-muutostesti  sent 15267 bytes  received 18244 bytes  5155.54 bytes/sec total size is 9175040  speedup is 273.79
Apr 29 08:27:01 (2013) cloudsync: Upload tranfer succeeded
From this simple test you can see that on the second serving, only 15kB needed to be sent to transfer the changes to the file. (and most of this is transferring the MD5 hashes of the file blocks I guess, plus the changed block when it is detected...)

The "speedup is 273.79" means that the filesize/(sent_bytes+received_bytes) = 273.79, so only 2.7% of the total file size needed to be sent on the second round.

Last edited by juiceme; 2013-04-29 at 05:44. Reason: Added some info
 

The Following 4 Users Say Thank You to juiceme For This Useful Post:
Posts: 63 | Thanked: 73 times | Joined on Jul 2012 @ Austria
#12
First of all, thanks for the script. After using it for some time I wanted to have easy access to the log, as well as a way of knowing when a sync is done. This is how I do it:

1) Redirect all output/logging to a log file (.txt extension)
2) After removing the lock file, open the txt-file via xdg-open (launches the document viewer)

Code:
G_LOGFILE="/home/user/logs/cloudsync.txt"

echo "logger text and output.." >> $G_LOGFILE

# after removing the lock file
xdg-open /home/user/logs/cloudsync.txt
 

The Following User Says Thank You to N9uwu For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 07:33.