Using rsync to perform backups

I’ve been trying various backup tools (for Windows) as of late to backup my files, but they all have had either way too much GUI cruft on top of them or they didn’t have as many features as I would have wanted. I eventually decided to stick to rsync, although I should have thought of that much sooner. Unfortunately, I discovered that Cygwin distribution does not support Unicode, and some of my filenames do contain Unicode characters. Bummer.

The good news is that there’s a UTF-8 compatible cygwin1.dll available. Just replace cygwin1.dll (you may want to back it up) in C:\cygwin\bin and you should be good to go. rsync won’t throw “file has vanished” errors for files with filenames containing Unicode characters anymore. Remember to restart any Cygwin-based service (i.e. sshd) after you replace that file.

Anyway, to make the backup, I create a list of folders and files in the directory I want to backup from and put each entry on its own line in a regular text file. I named it “backup_include”. I put the following code into a batch file to make it easy for me to run at any time.

@echo off
echo Performing backup...
echo.
rsync -v -r --inplace --times --delete-during --files-from=backup_include --human-readable --progress --log-file backup.log . /cygdrive/m/root

“.” refers to the current directory, which is where I am running rsync from. “/cygdrive/m/root” refers to the destination directory.

If you don’t have rsync installed, you can install Cygwin and select the rsync package.


One Response to Using rsync to perform backups

  1. I don’t get any of this sk89q. You are some scripting genius (For all I know).

    (Which is 0)

    [Zilch]

    {nada}


Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>