Backup using rsync

You need to install cygwin. Within the cygwin setup program, install rsync.

Suppose your user name is mike, and you install cygwin in C:\cygwin.

Create a shell script C:\cygwin\home\mike\data-backup.sh to do the job:

data-backup.sh
#!/bin/sh

# these are needed to support Chinese characters
LANG=en_US.UTF-8; export LANG
set meta-flag on 
set convert-meta off  # to show it as character, not the octal representation
set output-meta on  # to show 8-bit characters
set input-meta on


# sync my data files in C: drive to E: drive's backup folder:
rsync -av --delete --stats "/cygdrive/c/Documents and Settings/mike/My Documents" /cygdrive/e/backup/
rsync -av --delete --stats "/cygdrive/c/Documents and Settings/mike/桌面" /cygdrive/e/backup/

Create a batch file to run the shell script:

data-backup.bat
@echo off
cd C:\cygwin\bin
bash --login ~/data-backup.sh

tips/backup_using_rsync.txt · Last modified: 2010-02-04 16:00 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0