summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7888414)
updated the example.maildir to include this option, as well as detail the missing desid_file, destport
maildir:
. fix location of deleted_on file
. add missing destid_file options to ssh connections
maildir:
. fix location of deleted_on file
. add missing destid_file options to ssh connections
+ . added sshoptions variable for arbitrary ssh options
+ . updated example file to include destid_file, destport and sshoptions
mysql:
. Options passed to mysqldump are now customizable with the new
sqldumpoptions configuration variable. Thanks to Chris Lamb for his
mysql:
. Options passed to mysqldump are now customizable with the new
sqldumpoptions configuration variable. Thanks to Chris Lamb for his
# arbitrary bash commands on the desthost.
destuser = backer
# arbitrary bash commands on the desthost.
destuser = backer
+# For alternate ports from the default 22, specify here
+destport = 4444
+
+# If you need to specify an alternate ssh public key authentication file
+# do that here. Default: /root/.ssh/id_rsa
+destid_file = /home/backupkeys/.ssh/maildirbackup_id_rsa
+
+# If you need to specify other ssh configuration options, do that here
+sshoptions = "-C -6"
+
# remove any maildirs from backup which might have been deleted
remove = yes
# remove any maildirs from backup which might have been deleted
remove = yes
getconf destport 22
getconf destuser
getconf destid_file /root/.ssh/id_rsa
getconf destport 22
getconf destuser
getconf destid_file /root/.ssh/id_rsa
getconf multiconnection notset
getconf multiconnection notset
testflags="--dry-run -v"
fi
testflags="--dry-run -v"
fi
-rsyncflags="$testflags -e 'ssh -p $destport -i $destid_file' -r -v --ignore-existing --delete --size-only --bwlimit=$speedlimit"
+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/\*'"
##################################################################
excludes="--exclude '.Trash/\*' --exclude '.Mistakes/\*' --exclude '.Spam/\*'"
##################################################################
- ret=`$RSYNC -e "ssh -p $destport -i $destid_file" -r \
+ ret=`$RSYNC -e "ssh -p $destport -i $destid_file $sshoptions" -r \
--links --ignore-existing --delete --size-only --bwlimit=$speedlimit \
--exclude '.Trash/*' --exclude '.Mistakes/*' --exclude '.Spam/*' \
$source $destuser@$desthost:$target \
--links --ignore-existing --delete --size-only --bwlimit=$speedlimit \
--exclude '.Trash/*' --exclude '.Mistakes/*' --exclude '.Spam/*' \
$source $destuser@$desthost:$target \
fatal "100 rsync errors -- something is not working right. bailing out."
fi
fi
fatal "100 rsync errors -- something is not working right. bailing out."
fi
fi
- ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file "date +%c%n%s > $target/created"
+ ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file $sshoptions "date +%c%n%s > $target/created"
}
# remove any maildirs from backup which might have been deleted
}
# remove any maildirs from backup which might have been deleted
local tmp1=`maketemp maildir-tmp-file`
local tmp2=`maketemp maildir-tmp-file`
local tmp1=`maketemp maildir-tmp-file`
local tmp2=`maketemp maildir-tmp-file`
- ssh -p $destport -i $destid_file $destuser@$desthost mkdir -p "$destdir/deleted"
+ ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost mkdir -p "$destdir/deleted"
cd "$srcdir"
for userdir in `ls -d1 */`; do
ls -1 "$srcdir/$userdir" | sort > $tmp1
cd "$srcdir"
for userdir in `ls -d1 */`; do
ls -1 "$srcdir/$userdir" | sort > $tmp1
- ssh -p $destport -i $destid_file $destuser@$desthost ls -1 "$destdir/$userdir" | sort > $tmp2
+ ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost ls -1 "$destdir/$userdir" | sort > $tmp2
for deluser in `join -v 2 $tmp1 $tmp2`; do
[ "$deluser" != "" ] || continue
info "removing $destuser@$desthost:$destdir/$userdir$deluser/"
for deluser in `join -v 2 $tmp1 $tmp2`; do
[ "$deluser" != "" ] || continue
info "removing $destuser@$desthost:$destdir/$userdir$deluser/"
- ssh -p $destport -i $destid_file $destuser@$desthost mv "$destdir/$userdir$deluser/" "$destdir/deleted"
- ssh -p $destport -i $destid_file $destuser@$desthost "date +%c%n%s > '$destdir/deleted/$deluser/deleted_on'"
+ ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost mv "$destdir/$userdir$deluser/" "$destdir/deleted"
+ ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost "date +%c%n%s > '$destdir/deleted/$deluser/deleted_on'"
local userdir=${2%/}
local backuproot="$destdir/$userdir/$user"
(
local userdir=${2%/}
local backuproot="$destdir/$userdir/$user"
(
- ssh -T -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file <<EOF
+ ssh -T -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file $sshoptions <<EOF
##### BEGIN REMOTE SCRIPT #####
seconds_daily=86400
seconds_weekly=604800
##### BEGIN REMOTE SCRIPT #####
seconds_daily=86400
seconds_weekly=604800
local dir="$destdir/$userdir/$user/$backuptype"
local tmpdir="$destdir/$userdir/$user/rotate.tmp"
(
local dir="$destdir/$userdir/$user/$backuptype"
local tmpdir="$destdir/$userdir/$user/rotate.tmp"
(
- ssh -T -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file <<EOF
+ ssh -T -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file $sshoptions <<EOF
if [ ! -d $destdir ]; then
echo "Fatal: Destination directory $destdir does not exist on host $desthost."
exit 1
if [ ! -d $destdir ]; then
echo "Fatal: Destination directory $destdir does not exist on host $desthost."
exit 1
function start_mux() {
if [ "$multiconnection" == "yes" ]; then
debug "Starting dummy ssh connection"
function start_mux() {
if [ "$multiconnection" == "yes" ]; then
debug "Starting dummy ssh connection"
- ssh -p $destport -i $destid_file $destuser@$desthost sleep 1d &
+ ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost sleep 1d &
function end_mux() {
if [ "$multiconnection" == "yes" ]; then
debug "Stopping dummy ssh connection"
function end_mux() {
if [ "$multiconnection" == "yes" ]; then
debug "Stopping dummy ssh connection"
- ssh -p $destport -i $destid_file $destuser@$desthost pkill sleep
+ ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost pkill sleep
##################################################################
# see if we can login
##################################################################
# see if we can login
-debug "ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file 'echo -n 1'"
+debug "ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file $sshoptions 'echo -n 1'"
- result=`ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file 'echo -n 1' 2>&1`
+ result=`ssh -o PasswordAuthentication=no $desthost -l $destuser -i $destid_file $sshoptions 'echo -n 1' 2>&1`
if [ "$result" != "1" ]; then
fatal "Can't connect to $desthost as $destuser using $destid_file."
fi
if [ "$result" != "1" ]; then
fatal "Can't connect to $desthost as $destuser using $destid_file."
fi
start_mux
## SANITY CHECKS ##
start_mux
## SANITY CHECKS ##
-status=`ssh -p $destport -i $destid_file $destuser@$desthost "[ -d \"$destdir\" ] && echo 'ok'"`
+status=`ssh -p $destport -i $destid_file $sshoptions $destuser@$desthost "[ -d \"$destdir\" ] && echo 'ok'"`
if [ "$status" != "ok" ]; then
end_mux
fatal "Destination directory $destdir doesn't exist!"
if [ "$status" != "ok" ]; then
end_mux
fatal "Destination directory $destdir doesn't exist!"