Backup Notes

Cygwin/Rsync backup

1. Install Cygwin, with these packages:
  • Editors/vim
  • Net/openssh (and dependencies)
  • Net/rsync

2. Create backup config directory %USERDIR%\cygwin-backup

3. Add config files to backup directory:
  • exception_list.txt (list of files to ignore)
  • backuplist.txt (list of files/directories to back up, relative to the user profile path, Unix-style paths)
  • backup.sh (below)
  • backup.log (empty file)
  • backup.bat (below)

4. Create script backup.sh:

  • !/bin/bash

  • echo
    echo "backup started"
    USERDIR="/cygdrive/c/Documents and Settings/"
    BACKUPDIR=cygwin-backup
    RSYNCACCT=1034
    RSYNCSERV=usw-s001.rsync.net

    date
    cd "$USERDIR"
    rsync -rvte ssh --exclude-from=$BACKUPDIR/exception_list.txt --delete --files-from=$BACKUPDIR/backuplist.txt . $RSYNCACCT@$RSYNCSERV:backups/ |tee -a $BACKUPDIR/backup.log 2>&1
    scp $BACKUPDIR/backup.log $RSYNCACCT@$RSYNCSERV:backups/
    ssh $RSYNCACCT@$RSYNCSERV "chmod -R 770 backups"
    date

    5. Create SSH keys, in Cygwin Bash shell (accept defaults, do not use passphrase):
    ssh-keygen -t rsa

    6. Copy SSH public key up to server:
    scp .ssh/id_rsa.pub 1034@usw-s001.rsync.net:.ssh/authorized_keys

    7. Make backup script executable:
    chmod 775 /cygdrive/c/Documents\ and\ Settings//cygwin-backup/backup.sh

    8. Test:
    /cygdrive/c/Documents\ and\ Settings/Bill/cygwin-backup/backup.sh

    9. Create backup.bat batch file for Windows scheduler (edit path to .sh script):
    @echo off
    C:
    chdir C:\cygwin\bin
    bash --login -i -c "/cygdrive/c/Documents\ and\ Settings/Bill/cygwin-backup/backup.sh"

    10. Create schedule as desired, using Windows scheduler to launch the batch file (note a password for the user is required).

    11. Change password for the backup location, and record password in intranet:
    ssh -t 1034@usw-s001.rsync.net passwd

    Freelock Blog Posts

    Customer Feedback

    What a pleasure to work with Freelock in launching our family website for the West Seattle community. John and Jill were vital to our success. We quickly saw that Drupal could handle our scope of requirements and thrilled to find that many of our wish list features were doable with such a capable staff. Communication and support are out of this world impressive with the Freelock team and set the standard for the industry. On time and in budget. Freelock is the clear choice.

     

    Jackie Clough, Owner
    West Seattle Family Zone

    About Freelock

    We are located in the Fremont neighborhood of Seattle, WA. 3800 Woodland Park Ave. N. Seattle, WA 98103  USA [P] 206.577.0540 Contact Us | Site Map Get Updates ©1995-2011 Freelock Computing