projects
/
matthijs
/
upstream
/
backupninja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb8f89b
)
tar: Support running on multiple backends.
master
author
Matthijs Kooijman
<matthijs@stdin.nl>
Fri, 19 Mar 2010 20:31:46 +0000
(21:31 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Fri, 19 Mar 2010 20:41:05 +0000
(21:41 +0100)
handlers/tar.in
patch
|
blob
|
history
diff --git
a/handlers/tar.in
b/handlers/tar.in
index f75df22e7a124586ed88ffd69f8e91cba6024481..da8125fcc8db9eb05e4dcbe737447b900c8c59ba 100644
(file)
--- a/
handlers/tar.in
+++ b/
handlers/tar.in
@@
-3,8
+3,6
@@
#
# tar handler script for backupninja
#
# tar handler script for backupninja
-getconf backupname `hostname --fqdn`
-getconf backupdir /var/backups/`hostname --fqdn`
getconf compress bzip
getconf includes "/etc /home /usr/local"
getconf excludes "/tmp /proc /dev /sys /net /misc /media /srv /selinux"
getconf compress bzip
getconf includes "/etc /home /usr/local"
getconf excludes "/tmp /proc /dev /sys /net /misc /media /srv /selinux"
@@
-21,6
+19,11
@@
then
fi
function make_backup () {
fi
function make_backup () {
+ getconf backupdir /var/backups/`hostname --fqdn`
+ backupdir=`interpolate "$backupdir"`
+ getconf backupname `hostname --fqdn`
+ backupname=`interpolate "$backupname"`
+
if [ ! -d "$backupdir" ]
then
mkdir -p "$backupdir" || fatal "Can not make directory $backupdir"
if [ ! -d "$backupdir" ]
then
mkdir -p "$backupdir" || fatal "Can not make directory $backupdir"
@@
-62,16
+65,22
@@
function make_backup () {
exclude_options=""
for i in $excludes
do
exclude_options=""
for i in $excludes
do
- exclude_options="$exclude_options --exclude $i"
+ exclude_options="$exclude_options --exclude $root$i"
+ done
+
+ include_options=""
+ for i in $includes
+ do
+ include_options="$include_options $root$i"
done
debug "Running backup: " $TAR -c -p -v $compress_option $exclude_options \
-f "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`".$EXTENSION" \
done
debug "Running backup: " $TAR -c -p -v $compress_option $exclude_options \
-f "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`".$EXTENSION" \
- $includes
+ $include
_option
s
$TAR -c -p -v $compress_option $exclude_options \
-f "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`".$EXTENSION" \
$TAR -c -p -v $compress_option $exclude_options \
-f "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`".$EXTENSION" \
- $includes \
+ $include
_option
s \
> "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`.list \
2> "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`.err
> "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`.list \
2> "$backupdir/$backupname-"`$DATE "+$DATEFORMAT"`.err
@@
-79,4
+88,5
@@
function make_backup () {
}
}
-make_backup
+init_source_hosts
+run_for_source_hosts make_backup