]>
Commit | Line | Data |
---|---|---|
d87a489f | 1 | ##### <%= @dirname %> ##### |
4e8486c1 | 2 | PORT="<%= @port %>" |
d87a489f IB |
3 | DEST="<%= @dest %>" |
4 | BASE="<%= @base %>" | |
5 | OLD_BAK_BASE=$BASE/older/j | |
6 | BAK_BASE=${OLD_BAK_BASE}0 | |
7 | RSYNC_OUTPUT=$BASE/rsync_output | |
8 | NBR=<%= @nbr %> | |
9 | ||
10 | if ! ssh \ | |
11 | -o PreferredAuthentications=publickey \ | |
12 | -o StrictHostKeyChecking=yes \ | |
13 | -o ClearAllForwardings=yes \ | |
4e8486c1 | 14 | -p $PORT \ |
d87a489f IB |
15 | $DEST backup; then |
16 | echo "Fichier de verrouillage backup sur $DEST ou impossible de se connecter" >&2 | |
17 | skip=$DEST | |
18 | fi | |
19 | ||
20 | rm -rf ${OLD_BAK_BASE}${NBR} | |
21 | for j in `seq -w $(($NBR-1)) -1 0`; do | |
22 | [ ! -d ${OLD_BAK_BASE}$j ] && continue | |
23 | mv ${OLD_BAK_BASE}$j ${OLD_BAK_BASE}$(($j+1)) | |
24 | done | |
25 | mkdir $BAK_BASE | |
26 | mv $RSYNC_OUTPUT $BAK_BASE | |
27 | mkdir $RSYNC_OUTPUT | |
28 | ||
29 | if [ "$skip" != "$DEST" ]; then |