Jump to content

RSYNC Bandwith Saver


Guest anon
 Share

Recommended Posts

Guest anon

rsyncOptimum is a script to run in conjunction with rsync which can save you anything from a few bytes to hundreds of Megabytes in bandwith, and of course save you time.

The script was written by aru who i owe many thanks to.

The latest beta version is 1.4 and a link to the script along with known bugs is at the bottom of this page.

 

Rsync is a great tool, but has one drawback when trying to sync with a remote server where there are file version name changes/updates. For example say you have a local file called "fred_1.2" the remote server has a new version called "fred_1.3" when you run rsync it will see the 1.3 version as a new file and so download the entire file rather than just update the small changes in "fred_1.2"

The trick to get around this problem, is to rename "fred_1.2" to "fred_1.3" then run rsync in the normal way. This time rsync will only download and update the changes in the file rather than the whole file itself. The trick will even work with large ISOs so if you have say, three ISOs @650MB of MDK-9.2 and you wish to download MDK-10 just rename the old ISOs to MDK-10 then run rsync with your favorite mirror. This could save you a couple of hundred MB or more of bandwith and of course time.

 

So whats this script rsyncOptimum for?

Renaming one or two files is easy, but if like me you sync with hundreds of files on a remote server, renaming each one would take forever. I needed a script that would make all the name changes for me, and then run rsync in the normal way.

rsyncOptimum will first compare the names of files on a remote server with those on your local directory, if there are any...., it renames the local files to match those on the remote server and then executes rsync. Cool eh? I have already saved myself around 150MB of bandwith in the last two weeks alone!.

 

Known bugs and issues

This script will not work properly if multiple versions of the same file exist on the remote server.

The script is not designed to work in a local /directory to directory enviroment.

It is still in beta stage and under development, you may find other bugs or errors when using it.

There is a problem when using the rsync option "*"

You use this script at your own risk.

 

Installation and options

It can be installed in any directory of your choosing. To execute type ./rsyncOptimum

followed by any rsync option you choose. Example: ./rsyncOptimum -auv --delete --exclude "cooker/" ftp.pcds.ch::plf/ /var/ftp/pub/PLF/

Just like the dry run option "n" in rsync, rsyncOptimum also has a test switch. To see what changes would occur simply add --t onto the end of the command.

Hope you find this script as useful as i have. If you feel you can improve or fix any bugs please feel free to participate.

 

Here's the download link ftp://mandrakeusers.com/pub/Misc/rsyncOptimum

Note. This file will not execute until correct permissions are set.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...