Daily Backup for Windows 7 & Linux (Rsync)

Ideás for subjects

  • OSI Reference model
  • TCP/IP protocol suite
  • Simple Network Management Protocol

Daily Backup

I wan´t to tell You about the subject Daily Backup, which is very relevant for servers and as well for client.

The random subjects like Windows 7 & Linux (Rsync) is

  • Windows Backup (Microsoft Backup)

The backup utilities in previous versions of Windows have been less than spectacular resulting in a nice market for third party applications.  Today we take a look at the Backup and Restore feature in Windows 7  that may be their best backup tool yet.

Set the Backup

To set up a backup in Windows 7 open up Computer right-click on your local drive and select Properties.  Then click on the Tools tab and click the Back up now button.

Backup Now

In the Back up or restore your files window click the link to set up a backup.

Set Backup

Windows will search for a suitable drive to store the backup or you can also choose a location on your network.  If you backup to a network location you might need the password to the share.

1 external or network

You can have Windows choose what to backup or you can choose the files and directories.  Because I like more user control for this tutorial I am choosing what to backup but it’s completely up to you.

Note:  If you let Windows choose it will not backup Program Files, anything formatted with the FAT file system, files in the Recycle Bin, or any temp files that are 1GB or more.

settings

Select the files and folder to include in the backup.  Also notice you can select the option to create an image of your local drive.

choose

Now review the backup job and make sure everything looks correct.

review

Here you can also schedule the days and times the backup occurs.

schedule

Save the backup settings and kick off your first backup and while it runs you can monitor the progress.

in progress

Click the View Details button to see exactly what is being backup during the process.

details

When the backup is complete you will see the two backup files and image folder if you created one.  I backed up 20GB of data and it took around 15 minutes including the system image which came to 11GB.

sshot-11

Double click on the backup file and can restore files or manage the size of the backups folder.

managemenu

Restore Files from Backup

If you need to go back and restore a file from a backup click on Restore my files in the Backup and Restore Center.

rest

Now you can browse or search the most recent backup for a file or folder your missing.

chooserestore

Next you can restore them back to the original location or choose a different spot then click Restore.

location

Progress of the restoration will vary depending on the size of the data and location it’s restoring from.

prog

Manage Backup Size

Sometimes you may need to recover some disk space and Windows 7 allows you to manage the size of your backups.  In the Backup and Restore section click on the Manage Space link.

mgsizelink

Your given a summary of the backup location and what is taking up space from the backup.

mgspace

Click on the View backups button to check the different dated backups where you can delete older ones if needed.

sshot-2

You can also change how windows retains older system images.

mgsettinggs

Backing up data is one of the most important but overlooked tasks for a computer user.  If you have another backup app you might not consider letting Windows do it, but overall, the new backup and restore utility in Windows 7 is much better than previous versions.

  • Linux Backup (Rsync) backup to a spare diskI do local backups on several of my machines using rsync. I have an
    extra disk installed that can hold all the contents of the main
    disk. I then have a nightly cron job that backs up the main disk to
    the backup. This is the script I use on one of those machines. 

    #!/bin/sh

    export PATH=/usr/local/bin:/usr/bin:/bin

    LIST=”rootfs usr data data2″

    for d in $LIST; do
    mount /backup/$d
    rsync -ax –exclude fstab –delete /$d/ /backup/$d/
    umount /backup/$d
    done

    DAY=`date “+%A”`

    rsync -a –delete /usr/local/apache /data2/backups/$DAY
    rsync -a –delete /data/solid /data2/backups/$DAY

    The first part does the backup on the spare disk. The second part
    backs up the critical parts to daily directories.  I also backup the
    critical parts using a rsync over ssh to a remote machine.

    mirroring vger CVS tree

    The vger.rutgers.edu cvs tree is mirrored onto cvs.samba.org via
    anonymous rsync using the following script.

    #!/bin/bash

    cd /var/www/cvs/vger/
    PATH=/usr/local/bin:/usr/freeware/bin:/usr/bin:/bin

    RUN=`lps x | grep rsync | grep -v grep | wc -l`
    if [ “$RUN” -gt 0 ]; then
    echo already running
    exit 1
    fi

    rsync -az vger.rutgers.edu::cvs/CVSROOT/ChangeLog $HOME/ChangeLog

    sum1=`sum $HOME/ChangeLog`
    sum2=`sum /var/www/cvs/vger/CVSROOT/ChangeLog`

    if [ “$sum1” = “$sum2” ]; then
    echo nothing to do
    exit 0
    fi

    rsync -az –delete –force vger.rutgers.edu::cvs/ /var/www/cvs/vger/
    exit 0

    Note in particular the initial rsync of the ChangeLog to determine if
    anything has changed. This could be omitted but it would mean that the
    rsyncd on vger would have to build a complete listing of the cvs area
    at each run. As most of the time nothing will have changed I wanted to
    save the time on vger by only doing a full rsync if the ChangeLog has
    changed. This helped quite a lot because vger is low on memory and
    generally quite heavily loaded, so doing a listing on such a large
    tree every hour would have been excessive.

    automated backup at home

    I use rsync to backup my wifes home directory across a modem link each
    night. The cron job looks like this

    #!/bin/sh
    cd ~susan
    {
    echo
    date
    dest=~/backup/`date +%A`
    mkdir $dest.new
    find . -xdev -type f \( -mtime 0 -or -mtime 1 \) -exec cp -aPv “{}”
    $dest.new \;
    cnt=`find $dest.new -type f | wc -l`
    if [ $cnt -gt 0 ]; then
    rm -rf $dest
    mv $dest.new $dest
    fi
    rm -rf $dest.new
    rsync -Cavze ssh . samba:backup
    } >> ~/backup/backup.log 2>&1

    note that most of this script isn’t anything to do with rsync, it just
    creates a daily backup of Susans work in a ~susan/backup/ directory so
    she can retrieve any version from the last week. The last line does
    the rsync of her directory across the modem link to the host
    samba. Note that I am using the -C option which allows me to add
    entries to .cvsignore for stuff that doesn’t need to be backed up.

    The most common way to do this is by using the rsync -b –backup-dir= combination. I have seen examples of that usage here, but I won’t discuss it further, because there is a better way. If you’re not familiar with hard links, though, you should first start with the following review.

Reference:

Advertisements
This entry was posted in week 4 and tagged . Bookmark the permalink.

2 Responses to Daily Backup for Windows 7 & Linux (Rsync)

  1. mbnielsen says:

    I can add that I am using rdiff-backup on a weekly basis.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s