Rsync Backups for Windows

Source: Internet
Author: User
Tags rsync ssh server

Transfer your Windows Backups to a rsync server over SSH

Rsync.net provides cloud storage for offsite backups. If You run Windows systems, you can point them to us to secure your data.

Our cloud storage are better than AWS, Google or Azure because we give you a empty filesystem to do anything You want with.

Click here for simple pricing-or call 619-819-9156 Or email [email protected] for more information.

One thing you might choose to do are point your Windows backups to us using rsync over SSH.

Below is a tutorial that would work with any linux/unix/ssh server-not just rsync.net.

Rsync on Windows-an Overview

We no longer recommend that Windows users of your cloud storage platform use Rsync.exe to send their backups to rsync.net.

Cwrsync can difficult to set up, and getting it to run unattended, under the correct Windows account, can be challengin G.

Instead, we recommend either our free Windows Backup Agent or pay for a backupassist license with the Rsync module.

But if you must ...

Installing Cwrsync

Cwrsync is a free distribution of the Rsync utility which is optimized for quick and easy installation in Microsoft Windows .

You can download Cwrsync here, however we recommend checking for the newest version here.

Once You has downloaded this installation file, run it. You should select the defaults the installer gives, including the default installation path of:

C:\Program Files\cwrsync

We strongly recommend installing the program in the default location.

Setting up Your private/public Keypair

You need to create, and upload, an SSH public key so this your rsync backups can occur without your being prompted for a P Assword.

It is VERY IMPORTANT, the user who creates the key was the same user as the one who runs the automated backup. The easiest-ensure-to-log in as the local "administrator" to perform the following steps:

Click the Start button, and choose "Run". In the Run dialog box, type ' cmd ' and hit enter. The Command Prompt window (DOS prompt) would open.

In this command prompt, type:

cd "c:\program files\cwrsync\bin"

and hit Enter. Then type:

ssh-keygen -t rsa -N ‘‘

and hit Enter.

(Note that the line ends with a quote characters, one after another)

You'll be asked to ' enter file in which to save the key '-just hit Enter to accept the default, which is given.

Now, upload the newly created key to your rsync.net filesystem with this command:

rsync -av "/cygdrive/c/documents and settings/administrator/.ssh/id_rsa.pub" [email protected]:.ssh/authorized_keys

(Insert your own user ID in place of "1234" as well and the correct hostname in place of "s001")

When you run this rsync command, you'll be asked to confirm the first Connection-enter "yes", and when prompted for yo ur password, enter the password that is given to your in your welcome email.

Your RSA Public key are now uploaded to Your rsync.net filesystem, and any further logins over SSH, the This Windows user ( In this case, administrator) performs would not require a password.

Choosing What's Up

Now, need to decide. Generally, installed programs, like the ones installed in C:\Program Files was not important to back up, nor is your prima Ry C:\Windows folder. Generally you is interested in backing up your data, often times limited to c:\My Documents, or c:\Documents and Set Tings.

In this example we is choosing to back the following directory:

C:\Documents and Settings\Administrator

Open the rsync script by going to the Start menu, choosing Programs, then choosing Cwrsync, then choosing "1. Batch Example ". When you select this, the script would open in a text editor.

Leave the file exactly as it is-the settings in place is very important. You is simply going to add one or more rsync commands to the end of it, one for each folder or file you want to back up.

In this example we is adding a single line to the end of the file:

rsync -av --chmod u+rwx
-e "ssh -i c:\docume~1\administrator\.ssh\id_rsa"
"/cygdrive/c/Documents and Settings/administrator"
[email protected]:

You can see how the source directory:

C:\Documents and Settings\Administrator

is entered as

/cygdrive/c/documents and Settings/administrator

This transformation are required for all Windows source folders.

You can add as many rsync lines to the end of the "this" as "Like-one for each folder" you wish to back up.

Once The rsync lines has been added to the script, you should save the file and exit the editor.

Scheduling the Backup

All of the IS-to-schedule the backup, which is do through Task Scheduler, which is included in Windows.

Open Task Scheduler by Choosing:start Menu, Programs, accessories, System Tools, scheduled Tasks.

The scheduled Tasks Explorer would open. Double Click the item named "ADD scheduled Task".

In the first window, simply click "Next".

In the second window, you is asked to "Click on the program you want Windows to run". Choose a program from the list. Instead, click the "Browse" button.

Choose the program C:\Program Files\cwrsync\cwrsync.cmd

In the third window, you is asked to ' type a name for this task '-you can name it whatever your like. Perhaps "Rsync.net automated Backup".

You is also asked, in this third window, how often to perform the task. In this example we'll choose to perform the backup weekly.

In the fourth window, you is asked to choose a start time. We suggest sometime between 10pm and 6am. You should not perform these backups during the business day, as the network traffic they consume could affect your work.

In the fifth window, you were asked to ' Enter the name and password of a user '-this is the Windows login, the backup Would run under, and it is important so you choose the same Windows login so you used to create your RSA key, above. The username is entered in the form computername\username ... for instance:server01\administrator the password should be Entered as well.

In the sixth and final window, click "Finish".

Testing Your Backup

It is extremely important so you test your backup. You is testing not only that the backup works properly and transfers the files you think it would, but also that it would p Roperly log into your rsync.net filesystem without prompting to a password.

The first test, making sure the automated backup is not prompted for a password, was performed simply by running the backup yourself. From the Start menu, choose Run, and type in the location of your backup script:

C:\progra~1\cwrsync\cwrsync.cmd

You should see the backup run with the command prompt that appears, and it should complete without asking your for a password .

After you has completed a successful backup, and periodically as time goes on, you should then logs into your rsync.net AC Count and browse your filesystem.

The different methods of browsing your rsync.net filesystem in Windows is detailed here:

Windows Integration Overview

Additional Notes

-When testing your backup, being sure that Administrator are not logged onto the system twice-otherwise the DOS window Appears when your backup runs automatically from the Windows scheduler could appear in the other session (perhaps a remote Access login). Have the Administrator account logged into the system more than once can cause you don't to see error messages that'll h ELP you diagnose the batch file if it isn't running properly from the Windows scheduler.

-The sample rsync command above have a setting:--chmod u+rwx that ensures so all files are upload to Rsync.net, in Addi tion to whatever other permissions they has, is given Read/write/execute permission for the files owner. This setting was highly recommended and should only being altered if you know exactly. It should be noted, however, that's the result in files on the remote side with more permissive permissions than the so Urce files.

More information

Rsync.net publishes a wide array of support documents as well as a FAQ

You, or your CEO, could find our CEO Page useful.

Please see our HIPAA and Sarbanes-oxley Complianc e statements.

Contact [e-mail protected] for more information, and answers to your questions.

Http://www.rsync.net/resources/howto/windows_rsync.html

Rsync Backups for Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.