+++ /dev/null
-#!/bin/bash
-DEST="<%= @dest %>"
-MAILTO="<%= @mailto %>"
-BASE="<%= @base %>"
-OLD_BAK_BASE=$BASE/older/j
-BAK_BASE=${OLD_BAK_BASE}0
-RSYNC_OUTPUT=$BASE/rsync_output
-NBR=7
-
-TMP=`mktemp`
-TMP_STDERR=`mktemp`
-
-trap "rm -f $TMP $TMP_STDERR" EXIT
-
-exec 2> "$TMP_STDERR"
-
-set -e
-if ! `ssh -o ClearAllForwardings=yes $DEST backup`; then
- echo "Fichier de verrouillage backup sur $DEST"
- exit 1
-fi
-
-rm -rf ${OLD_BAK_BASE}${NBR}
-for j in `seq -w $(($NBR-1)) -1 0`; do
- [ ! -d ${OLD_BAK_BASE}$j ] && continue
- mv ${OLD_BAK_BASE}$j ${OLD_BAK_BASE}$(($j+1))
-done
-mkdir $BAK_BASE
-mv $RSYNC_OUTPUT $BAK_BASE
-mkdir $RSYNC_OUTPUT
-
-##############
-NAME="home"
-FOLDER="/home/immae"
-
-cd $BASE/$NAME
-cat > $TMP <<EOF
-/.no_backup/
-/hosts/florian/nobackup/
-/hosts/connexionswing.com/
-/hosts/connexionswing.immae.eu/
-/hosts/ludivine.immae.eu/
-/hosts/ludivinecassal.com/
-/hosts/piedsjaloux.fr/
-/hosts/piedsjaloux.immae.eu/
-/hosts/spip/sites/*/
-/hosts/spip/spip*
-EOF
-OUT=$RSYNC_OUTPUT/$NAME
-rsync -XAavbrz --fake-super -e ssh --numeric-ids --delete \
- --backup-dir=$BAK_BASE/$NAME --exclude-from=$TMP \
- $DEST:$FOLDER . > $OUT || true
-
-##############
-NAME="system"
-FOLDER="/"
-
-cd $BASE/$NAME
-cat > $TMP <<EOF
-/etc/
-/srv/
-/var/lib/
-/var/spool/
-/var/named/
-/usr/local/
-EOF
-OUT=$RSYNC_OUTPUT/$NAME
-rsync -XAavbrz -R --fake-super -e ssh --numeric-ids --delete \
- --rsync-path='sudo rsync' \
- --backup-dir=$BAK_BASE/$NAME \
- --files-from=$TMP \
- $DEST:$FOLDER . > $OUT || true
-
-##############
-ssh $DEST sh -c "date > .last_backup"
-
-if [ -s "$TMP_STDERR" ]; then
- cat "$TMP_STDERR" | mail -Ssendwait -s "save_distant rsync error" "$MAILTO"
-fi