]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Change last_backup location for backup
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 26 Feb 2019 11:43:27 +0000 (12:43 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 18 Mar 2019 23:53:18 +0000 (00:53 +0100)
modules/role/templates/backup/backup_dirname_tail.sh.erb
modules/role/templates/backup/backup_immae_eu.sh.erb [deleted file]

index 6b16c9dfe06085b4d2abb91ecd00b09912ab1a11..50279920f41579675b33d6ba324c64901c15a522 100644 (file)
@@ -1,4 +1,4 @@
 
-  ssh $DEST sh -c "date > .last_backup"
+  ssh $DEST sh -c "date > .cache/last_backup"
 fi # [ "$skip" != "$DEST" ]
 ##### End <%= @dirname %> #####
diff --git a/modules/role/templates/backup/backup_immae_eu.sh.erb b/modules/role/templates/backup/backup_immae_eu.sh.erb
deleted file mode 100644 (file)
index 4fab30e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/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