aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'handlers')
-rw-r--r--handlers/maildir.in3
-rw-r--r--handlers/mysql.in13
-rw-r--r--handlers/rsync.in15
-rw-r--r--handlers/sys.in24
4 files changed, 34 insertions, 21 deletions
diff --git a/handlers/maildir.in b/handlers/maildir.in
index 912c0e6..64ac987 100644
--- a/handlers/maildir.in
+++ b/handlers/maildir.in
@@ -85,9 +85,6 @@ if [ $test ]; then
testflags="--dry-run -v"
fi
-rsyncflags="$testflags -e 'ssh -p $destport -i $destid_file $sshoptions' -r -v --ignore-existing --delete --size-only --bwlimit=$speedlimit"
-excludes="--exclude '.Trash/\*' --exclude '.Mistakes/\*' --exclude '.Spam/\*'"
-
##################################################################
### FUNCTIONS
diff --git a/handlers/mysql.in b/handlers/mysql.in
index 65deebb..6ade49e 100644
--- a/handlers/mysql.in
+++ b/handlers/mysql.in
@@ -256,10 +256,15 @@ then
for db in $databases
do
DUMP_BASE="$MYSQLDUMP $defaultsfile $sqldumpoptions"
- if [ "$db" = "information_schema" ] || [ "$db" = "performance_schema" ]
- then
- DUMP_BASE="${DUMP_BASE} --skip-lock-tables"
- fi
+
+ case "$db" in
+ information_schema)
+ DUMP_BASE="${DUMP_BASE} --skip-lock-tables"
+ ;;
+ performance_schema)
+ DUMP_BASE="${DUMP_BASE} --skip-lock-tables --skip-events"
+ ;;
+ esac
# Dumping structure and data
DUMP="$DUMP_BASE $ignore $db"
diff --git a/handlers/rsync.in b/handlers/rsync.in
index 386255e..f0df52f 100644
--- a/handlers/rsync.in
+++ b/handlers/rsync.in
@@ -275,8 +275,15 @@ function eval_config {
mv=move_files
fi
- excludes=`echo "$exclude" | @SED@ -e "s/^/--exclude='/g" -e "s/ /' --exclude='/g" -e "s/$/'/"`
-
+ set -o noglob
+ SAVEIFS=$IFS
+ IFS=$(echo -en "\n\b")
+ for i in $exclude; do
+ str="${i//__star__/*}"
+ excludes="${excludes} --exclude='$str'"
+ done
+ IFS=$SAVEIFS
+ set +o noglob
}
function rotate_short {
@@ -1109,9 +1116,9 @@ for SECTION in $include; do
set_dest
info "Syncing $SECTION on $dest_path..."
- debug $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path
+ debug $nice $rsync ${rsync_options[@]} $filelist_flag $excludes $batch_option $orig $dest_path
set_pipefail
- $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path | tee -a $log
+ $nice su -c "$rsync ${rsync_options[@]} --delete-excluded $filelist_flag $excludes $batch_option $orig $dest_path" | tee -a $log
if [ "$?" != "0" ]; then
fatal "Rsync error when trying to transfer $SECTION"
diff --git a/handlers/sys.in b/handlers/sys.in
index 74133a3..92998cc 100644
--- a/handlers/sys.in
+++ b/handlers/sys.in
@@ -348,13 +348,15 @@ echo "Getting information about the kernel."
echo
STATUS="Getting kernel version:"
catifexec "/bin/uname" "-a"
-STATUS="Checking module information:"
-catifexec "/sbin/lsmod"
-for x in $(/sbin/lsmod | /usr/bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null
-) ; do
- STATUS="Checking module information $x:"
- catifexec "/sbin/modinfo" "$x"
-done
+if [ "$hardware" == "yes" ]; then
+ STATUS="Checking module information:"
+ catifexec "/sbin/lsmod"
+ for x in $(/sbin/lsmod | /usr/bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null
+ ) ; do
+ STATUS="Checking module information $x:"
+ catifexec "/sbin/modinfo" "$x"
+ done
+fi
STATUS="Gathering information about your filesystems:"
catiffile "/proc/filesystems"
@@ -432,9 +434,11 @@ catiffile "/proc/rtc"
STATUS="Gathering information about your ide drivers:"
catiffile "/proc/ide"
-STATUS="Gathering information about your bus:"
-catifexec "/usr/bin/lspci"
-catiffile "/proc/bus"
+if [ "$hardware" == "yes" ]; then
+ STATUS="Gathering information about your bus:"
+ catifexec "/usr/bin/lspci"
+ catiffile "/proc/bus"
+fi
echo
echo "Getting disk and filesystem information."