|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
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:\" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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. |
|
|
|
|
|
|
|
|
|
|