From 23fd00ce5f8aa6d8419d56166f658361c1321add Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 26 Feb 2019 12:43:27 +0100 Subject: [PATCH] Change last_backup location for backup --- .../backup/backup_dirname_tail.sh.erb | 2 +- .../templates/backup/backup_immae_eu.sh.erb | 79 ------------------- 2 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 modules/role/templates/backup/backup_immae_eu.sh.erb 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 -- 2.41.0