Explorar el Código

fix(tarsnap): rotate script fails on error

Scripts used to rotate tarsnap backups exit when a command fails
Cron will catch that return code is not zero and will send message to root

No more silent failure
Bertrand Cachet hace 11 años
padre
commit
ead57335be
Se han modificado 1 ficheros con 2 adiciones y 7 borrados
  1. 2
    7
      roles/tarsnap/files/tarsnap.sh

+ 2
- 7
roles/tarsnap/files/tarsnap.sh Ver fichero

@@ -22,11 +22,12 @@ MONTHLY=1
22 22
 MONTHLY_DAY=01
23 23
 
24 24
 # Path to tarsnap
25
-#TARSNAP="/home/tdb/tarsnap/tarsnap.pl"
26 25
 TARSNAP="/usr/local/bin/tarsnap"
27 26
 
28 27
 # end of config
29 28
 
29
+set -e
30
+
30 31
 # day of week: 1-7, monday = 1
31 32
 DOW=`date +%u`
32 33
 # day of month: 01-31
@@ -52,12 +53,6 @@ fi
52 53
 
53 54
 # Do backups
54 55
 for dir in $DIRS; do
55
-	# nasty bodge for my large /home :-)
56
-	EXTRA_FLAGS=
57
-	if [ X"$dir" = X"/home" ]; then
58
-		EXTRA_FLAGS="--lowmem"
59
-	fi
60
-
61 56
 	echo "==> create $BACKUP-$dir"
62 57
 	$TARSNAP $EXTRA_FLAGS -c -f $BACKUP-$dir $dir
63 58
 done

Loading…
Cancelar
Guardar