From: Ismaƫl Bouya Date: Tue, 26 Feb 2019 11:43:27 +0000 (+0100) Subject: Change last_backup location for backup X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=23fd00ce5f8aa6d8419d56166f658361c1321add;p=perso%2FImmae%2FProjets%2FPuppet.git Change last_backup location for backup --- diff --git a/modules/role/templates/backup/backup_dirname_tail.sh.erb b/modules/role/templates/backup/backup_dirname_tail.sh.erb index 6b16c9d..5027992 100644 --- a/modules/role/templates/backup/backup_dirname_tail.sh.erb +++ b/modules/role/templates/backup/backup_dirname_tail.sh.erb @@ -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 index 4fab30e..0000000 --- a/modules/role/templates/backup/backup_immae_eu.sh.erb +++ /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 < $OUT || true - -############## -NAME="system" -FOLDER="/" - -cd $BASE/$NAME -cat > $TMP < $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