Search Computing Unplugged's 16,487 article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Backup server file changes with Rsync (continued)

FIGURE A


Install Rsync as a service. Roll over picture for a larger image.

It turns out there's a slight problem doing this. DeltaCopy sets itself up as a service under the currently logged in user, instead of as the Local System, so you'll have to open up Services and change that to make it work right.

Next, you'll need to specify a virtual backup directory, as shown in Figure B. This is a bit annoying, but as you can see, you're basically mapping a name (like "Backups") to a directory path (like "C:\Backups").

FIGURE B


Map your backup directory. Roll over picture for a larger image.

And that's it for the server side. Make sure the service is running and you're basically done.

Setting up the client
Next, you're going to want to do the same install process on the machine that's serving as the destination for the backups. Only this time, don't install the service. What you're doing here is merely using the DeltaCopy installer as a quick and dirty way to install rsync.exe on your machine.

DeltaCopy has a slight weirdness about it, in that it likes to think of the server as the destination machine and the client as the source machine. We didn't like that, and decided to avoid the whole mess by simply writing our own rsync batch files. This is what you should do as well.

Do do this, create a folder that you'll use to keep your batch files and also create a destination directory for your backups. We used "backups" because we're creative that way. Next, we'll create the two commands you'll need to use.

Getting the permissions right
Because Rsync is really a Linux program, it likes to use Linux permissions. These don't map correctly (or at least they didn't for us) when using Rsync on Windows. When we first ran Rsync, we found all the files and the directories weren't accessible until we took ownership of them. This can be a pain, and if you do a backup to a local machine and then fling those backed up files around the local network, as we do for further backup and for development, having ownership-locked files is annoying.

Fortunately, there's a one-line batch command you can use to fix this. Took us almost half a day to find it, so send us cookies. You owe us:

set CYGWIN=nontsec

Yep, that tells Cygwin to not use NT security, which, paradoxically, makes it work with our Windows-based security, which, after all, is based on NT. Go figure. It works. Type it in.

Sucking the files down
Next up is the command line for pulling down the files themselves. Obviously, you'll need to change things to work for you, but here's our line:

"C:\Program Files\Synametrics Technologies\DeltaCopy\rsync.exe" -vv -r -h -z --stats --delete-delay --partial-dir=".rsync-partials" "www.myserver.com::Backups/myDir/" "/cygdrive/D/backups/MyDir/"

You can see how each parameter works in Table A.

Element Description
"C:\Program Files\Synametrics Technologies\DeltaCopy\rsync.exe" The DeltaCopy installer drops rsync.exe and the Cygwin DLLs into this program file directory and while you can add it to your path, we just found it easier to directly reference the program in its installed directory.
-vv This is the verbosity flag. The -vv indicates more verbosity. We like verbosity. Leave this out if you don't want Rsync to talk to you all that much.
-r Recurse through all lower directories as well.
-h Show all numbers in human-readable form. Case matters in Rsync. Make sure you use -h instead of -H. -H (capitalized) means "preserve hard links".
-z Compress the data as it's transmitted.
--stats More verbosity. This tells Rsync to print some transfer stats when it's done. You can leave this out if you want as well, but what fun would that be?
--delete-delay This causes deletions in the sync to occur after the file transfer pass is complete. We like it because stuff isn't deleted until we know the file transfer part worked.
--partial-dir=".rsync-partials" This tells Rsync to keep partial file transfers. This is really important when transfering 25 gigabyte files for the first time. If the transfer is interrupted, this option tells Rsync to save what's already been transfered and resume later.
"www.myserver.com::Backups/myDir/" This is the directory on the server, located under the virtual directory.
"/cygdrive/D/backups/MyDir/" This is the directory on the local machine. You can't just use "D:\backups\MyDir". Instead, you need to use a Cygwin/Linux drive naming format, where "/cygdrive/D/" is the functional equivalent of "D:\"

« Previous  ·  1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Reviews > Software > PC (21 articles)
   VMWare Fusion makes your Mac one machine to rule them all
   UltraEdit is an ultra-useful editor
   Use the i-Sound Pro recorder to beef up your radio chops
Home > Solutions > Webmaster tech (2 articles)
   VMWare Fusion makes your Mac one machine to rule them all
Home > Solutions > Backup strategies (2 articles)
   Eight steps to successful and reliable home backups
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent Computing Unplugged Articles
When WordPress 3.0 Multisite won't let you log in
Choosing the right smartphone for you
Picture Porter 35, a portable hard drive/viewer for photographers
Time to pay the paper?
Photoshop CS5's great new lens correction feature
Photoshop CS5's great new high dynamic range imaging features
Photoshop CS5's great new Puppet Warp feature
Computing Unplugged News
Android wallpaper app that steals your data was downloaded by millions
New Zealand pizza lovers suffer information theft from Hell
Could open source tools make Facebook the next AOL?
Amazon unveils 3rd-generation Kindle e-book reader
Dell Streak: What a Mess
$20 Wikipedia Reader Uses 8-Bit Computing Power
Google Assembles Parts for Facebook Rival
>> Read all the news
More from the ZATZ journals
David Gewirtz Online: CNN commentary and analysis
DominoPower: Smart Upgrade bug in Domino 8.5.1 (and some work-around tips)
OutlookPower: The two most motivational words in the English language
-- Advertisement --

BLOGGING AND PODCASTING WITH ONE EASY-TO-USE TOOL
Now you can publish your thoughts, opinions, and comments in your own blog or podcast.<p />

  • Supports multiple authors and multiple blogs or podcasts.
  • Generate and publish RSS feeds for iTunes and other directories.
  • Post photos, images or animations.
  • Get feedback and have conversations with visitors to your site. <p />

Personalize your blog or podcast with your own unique domain name -- or integrate it with your existing site by setting it up as a subdomain.

Tap here and get blogging or podcasting within minutes.

-- Advertisement --

How To Save Jobs
This book is about how to create and save jobs. Believe it or not, there's not a single book out there that specifically focuses on job creation and preservation -- until now.

This book, by ZATZ editor-in-chief David Gewirtz, is about helping your business work better. It's about helping you change the things you need to change so your company can perform more effectively.

Plus, through a grant from ZATZ, it's a free download.

Read it and reap.

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 2003-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login