X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2Fbackup;h=adb5e50df2087e6b3d2a7f49eb374a30b28ece32;hb=29e7a76b102f27fe3017887c8936665ba9932d98;hp=ef98e9e099eb50144f9a449fb4dd2e68c0431d88;hpb=020a4a5ea2be725b155cae3a2cadc9aba3911b9b;p=clearscm.git diff --git a/bin/backup b/bin/backup index ef98e9e..adb5e50 100755 --- a/bin/backup +++ b/bin/backup @@ -15,7 +15,8 @@ # Full Backup backup=/sbin/dump dumppath=/backup -files2backup=/ +filesystems="sda1 sdb1" +compression=9 if [ -f /etc/dump.excludes ]; then excludes="-E /etc/dump.excludes" @@ -38,12 +39,10 @@ function usage { type="$1" host=$(hostname) -host=$(hostname) - if [ "$type" = "full" ]; then - rm -f $dumppath/$host.$type.backup - rm -f $dumppath/$host.$type.backup.log - rm -f $dumppath/$host.$type.list + rm -f $dumppath/$host.*.$type.backup + rm -f $dumppath/$host.*.$type.backup.log + rm -f $dumppath/$host.*.$type.list level=0 elif [ "$type" = "incremental" ]; then level=1 @@ -51,11 +50,12 @@ else usage $type fi -log=$dumppath/$host.$type.backup.log - -$backup -$level\ - -A $dumppath/$host.$type.list\ - -f $dumppath/$host.$type.backup\ - -z\ - $excludes\ - -u $files2backup > $log 2>&1 +for fs in $filesystems; do + log=$dumppath/$host.$fs.$type.backup.log + $backup -$level\ + -A $dumppath/$host.$fs.$type.list\ + -f $dumppath/$host.$fs.$type.backup\ + -z$compression\ + $excludes\ + -u /dev/$fs > $log 2>&1 +done