11ff8da8a636d58801c3adcd4ecbb49ae4bb7e05
3 # ============================================================================
4 # Copyright (C) THALES. All rights reserved
5 # Author: Laurent Mazet
7 # * 05/12/2014 ajout tarbal acq et rec
8 # ============================================================================
13 PROGNAME
=$
(basename $0)
14 BLADES
="acq slave rec"
16 EXCLUDE
=/tmp
/$PROGNAME-exclude-$$
18 TMPLOG
=/tmp
/$PROGNAME-$$.log
24 echo "usage: $PROGNAME [-h] [-v]"
25 echo " -h: help message"
26 echo " -v: version message"
32 function title
() { echo -e "\033[0;1m$*\033[0;0m"; }
33 function pass
() { echo -e "\033[1;32m$*\033[0;0m"; }
34 function warn
() { echo -e "\033[1;33m$*\033[0;0m"; }
35 function fail
() { echo -e "\033[1;31m$*\033[0;0m"; }
40 { eval $@
; } >&$TMPLOG && pass OK ||
{ fail KO
; cat $TMPLOG; ERR
=yes; }
47 while [ $# -gt 0 ]; do
50 -v) echo "$PROGNAME: version $VER"; exit;;
51 *) echo "unknown argument ($1)"; exit 1;;
57 cat - <<EOF > $EXCLUDE
66 for target
in $BLADES; do
67 tarball
=$TFTP/$target.tgz
68 repository
=$CLUSTER/$target
69 [ -d "$repository" ] ||
{ warn
"directory '$repository' does not exist"; continue; }
70 [ -f $tarball ] && check
rm -f $tarball
72 check
tar czf
$tarball --exclude-from $EXCLUDE .