5 TESTLOG_PREFIX=${TESTLOG_PREFIX:-$TMP/recovery-mds-scale}
6 TESTNAME=${TESTNAME:-""}
7 [ -n "$TESTNAME" ] && TESTLOG_PREFIX=$TESTLOG_PREFIX.$TESTNAME
9 LOG=$TESTLOG_PREFIX.$(basename $0 .sh)_stdout.$(hostname -s).log
10 DEBUGLOG=$(echo $LOG | sed 's/\(.*\)stdout/\1debug/')
18 . $(dirname $0)/functions.sh
20 assert_env MOUNT END_RUN_FILE LOAD_PID_FILE LFS CLIENT_COUNT LCTL
24 # recovery-*-scale scripts use this to signal the client loads to die
25 echo $$ >$LOAD_PID_FILE
27 TESTDIR=$MOUNT/d0.tar-$(hostname)
30 tar cf - /etc | tar xf - >$LOG 2>&1
31 return ${PIPESTATUS[1]}
35 while [ ! -e "$END_RUN_FILE" ] && $CONTINUE; do
36 echoerr "$(date +'%F %H:%M:%S'): tar run starting"
41 USAGE=$(du -s /etc | awk '{print $1}')
42 $LCTL set_param llite.*.lazystatfs=0
45 FREE_SPACE=$(df $TESTDIR | awk '/:/ { print $4 }')
46 AVAIL=$((FREE_SPACE * 9 / 10 / CLIENT_COUNT))
47 if [ $AVAIL -lt $USAGE ]; then
48 echoerr "no enough free disk space: need $USAGE, avail $AVAIL"
49 echo $(hostname) >> $END_RUN_FILE
55 PREV_ERRORS=$(grep "exit delayed from previous errors" $LOG) || true
56 if [ $RC -ne 0 -a "$ERRORS_OK" -a "$PREV_ERRORS" ]; then
57 echoerr "$(date +'%F %H:%M:%S'): tar errors earlier, ignoring"
60 if [ $RC -eq 0 ]; then
61 echoerr "$(date +'%F %H:%M:%S'): tar succeeded"
64 echoerr "$(date +'%F %H:%M:%S'): tar run finished"
66 echoerr "$(date +'%F %H:%M:%S'): tar failed"
67 if [ -z "$ERRORS_OK" ]; then
68 echo $(hostname) >> $END_RUN_FILE
70 if [ $BREAK_ON_ERROR ]; then
77 echoerr "$(date +'%F %H:%M:%S'): tar run exiting"