Rsync on Windows for Strongspace
Posted 13 August 2006, 11:48. (Filed under: Geek by Andrew)
David Barrett has posted a fantastic tutorial about using rsync on Windows to backup to Strongspace.
It got me 90% of the way there, but there are a couple of unanswered questions. So here are the steps I’ve taken to do this. I’ve not included any screenshots, because David’s got that pretty much covered.
The idea is to do this without a full install of Cygwin. I think Cygwin’s wonderful, and I use it all the time, but this rsync thing needs to work with the smallest set of applications, using utilities (and a shell) that everyone’s got. In fact, I’ve found that having Cygwin was a problem for me, as it was difficult to tell which versions of the cwRsync modules were being used – the ones that came with it, or the Cygwin ones. The default location for the .ssh folder is based on the Cygwin home directory, which on my PC is c:\cygwin\home\Kember because I’ve got a full-time cygwin installation. David’s tutorial says that the default location if you’ve got no Cygwin installation is in in your Windows home directory, e.g. C:\Documents and Settings\Kember.
Right. Here we go. Get your Windows XP PC and phone Microsoft to check you’ve got a valid licence, then ask them if they can sell you any more great software (kidding).
Install the software and test it
- Install the latest stable version of cwRsync to
c:\cwRsync, instead of the default which is inProgram Files. cwRsync is a collection of open source tools put together in a way that makes rsync work on Windows. - You need to modify your PATH environment variable. Add
C:\cwRsync\bin;to it. Make sure it’s got a semicolon between each item – look at the other items in the PATH statement if you need a hint. - Add a user environment variable called
RSYNC_RSHwith the valuessh.exe - Now you need to test this.
- Start a command prompt (Start > Run; type
cmd; press enter - Enter the following:
c: cd c:\rsync -avz --delete "cwRsync/doc" username@subdomain.strongspace.com:testrsyncThis is all on one line.- Warning! If you already have a directory called testrsync/cwRsync in the Home directory of your Strongspace account, then this command will delete the contents of it.(Warning copied from David!)
- Remember to replace
usernameandsubdomainwith the right bits from your Strongspace account - Windows firewall may ask you if you want to block this application. Check that the app to be unblocked is the correct one, then unblock it.
- As this is the first time you’ve connected to Strongspace with this ssh thingy, it’ll prompt you about caching the key and continuing the connection. Enter
yes - When prompted, enter your Strongspace password
- Watch the files upload. Once it finishes, check your Strongspace account, to make sure they’re all present and correct.
- Start a command prompt (Start > Run; type
Making the SSH keys
This is so you don’t need to put in your password each time rsync connects to Strongspace.
- Open a new command prompt
- Make sure you’re in your home directory (that’s where it should be by default)
- Enter the following:
ssh-keygen -P "" -t dsa - It will ask you where you want to put the files, and what you want to call them. Accept the default location, but remember where it is!
- Change directory into the default location, and into the .ssh directory
copy id_dsa.pub authorized_keyscd ..rsync -avz ".ssh/authorized_keys" username@subdomain.strongspace.com:.ssh/authorized_keys- del .ssh\authorized_keys
- Now you need to test this.
- Start a command prompt (Start > Run; type
cmd; press enter - Enter the following:
c: cd c:\rsync -avz --delete "cwRsync/doc" username@subdomain.strongspace.com:testrsync- Watch the files upload. Once it finishes, check your Strongspace account, to make sure they’re all present and correct.
- Start a command prompt (Start > Run; type
This should not prompt you for your password. If it does, then we’ve done something wrong.
* * *
< How long should I keep my financial records? |
| Using Windows Live Writer beta with Textpattern >