projects
/
clearscm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
425cf1e
)
Changed backup to work with new disks
author
Andrew DeFaria
<Andrew@DeFaria.com>
Fri, 20 Jun 2014 16:45:44 +0000
(09:45 -0700)
committer
Andrew DeFaria
<Andrew@DeFaria.com>
Fri, 20 Jun 2014 16:45:44 +0000
(09:45 -0700)
bin/backup
patch
|
blob
|
history
diff --git
a/bin/backup
b/bin/backup
index
ef98e9e
..
adb5e50
100755
(executable)
--- a/
bin/backup
+++ b/
bin/backup
@@
-15,7
+15,8
@@
# Full Backup
backup=/sbin/dump
dumppath=/backup
# Full Backup
backup=/sbin/dump
dumppath=/backup
-files2backup=/
+filesystems="sda1 sdb1"
+compression=9
if [ -f /etc/dump.excludes ]; then
excludes="-E /etc/dump.excludes"
if [ -f /etc/dump.excludes ]; then
excludes="-E /etc/dump.excludes"
@@
-38,12
+39,10
@@
function usage {
type="$1"
host=$(hostname)
type="$1"
host=$(hostname)
-host=$(hostname)
-
if [ "$type" = "full" ]; then
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
level=0
elif [ "$type" = "incremental" ]; then
level=1
@@
-51,11
+50,12
@@
else
usage $type
fi
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