2 ################################################################################
4 # File: $RCSfile: backup,v $
5 # Revision: $Revision: 1.7 $
6 # Description: This script backs up the system in a consistent way
7 # Author: Andrew@DeFaria.com
8 # Created: Tue Jul 27 15:00:11 PDT 2004
9 # Modified: $Date: 2011/05/26 06:17:20 $
12 # (c) Copyright 2000-2005, ClearSCM, Inc., all rights reserved.
14 ################################################################################
18 filesystems="sda1 sdb1"
21 if [ -f /etc/dump.excludes ]; then
22 excludes="-E /etc/dump.excludes"
27 if [ $(id -u) -ne 0 ]; then
28 echo "You must be root to backup"
35 echo "Usage: backup <full | incremental>"
42 if [ "$type" = "full" ]; then
43 rm -f $dumppath/$host.*.$type.backup
44 rm -f $dumppath/$host.*.$type.backup.log
45 rm -f $dumppath/$host.*.$type.list
47 elif [ "$type" = "incremental" ]; then
53 for fs in $filesystems; do
54 log=$dumppath/$host.$fs.$type.backup.log
56 -A $dumppath/$host.$fs.$type.list\
57 -f $dumppath/$host.$fs.$type.backup\
60 -u /dev/$fs > $log 2>&1