#!/bin/sh ## ## SCRIPT: 00_rsync_bkup_2maxtor.sh in $HOME/Rsync ## ## PURPOSE: This script uses 'rsync' to backup data files ## (esp. home directory) --- to an external disk drive. ## ## HOW TO USE: Can make a desktop icon to run this script by ## simply clicking on the icon --- ## after the external disk drive is attached and ## running (powered up). ## ## BUT ... you will not see the messages from the rsync ## command unless you set this script up to be ## run within a terminal window. ## ## (It is good to check the current size of the home directory to see if ## if fits on the external drive.) ## ## Reference: Linux Format Magazine #130, Apr 2010, p.105, Answers section ## ## 'rsync' only copies files that are different. With large files that ## have changed, it only copies the parts that have been altered. ## Its main parameters are a 'from' directory and a 'to' directory. ## ## The '--delete' option removes files not present on the first directory. ## The '--archive' option causes all file permissions and timestamps to be copied to. ## ## The trailing slashes on the directory names are important because they indicate ## that you want to sync the contents of the folders. If you omit them, you could ## end up copying one directory into another. ## ## Since we may be using an MS Windows FAT file system on the 'to' drive, ## we use '--modify-window=1', as explained here: ## --modify-window ## When comparing two timestamps, rsync treats the timestamps as ## being equal if they differ by no more than the modify-window ## value. This is normally 0 (for an exact match), but you may ## find it useful to set this to a larger value in some situations. ## In particular, when transferring to or from an MS Windows FAT ## filesystem (which represents times with a 2-second resolution), ## --modify-window=1 is useful (allowing times to differ by up to 1 ## second). ## ## Created: 2010apr19 ## Changed: set -x ## rsync --archive --delete /path/to/source/ /path/to/dest/ rsync --archive --delete -vv --modify-window=1 /home/blaze/ /media/Maxtor160GB/home/blaze/ set -