while [ "$1" ]; do
case $1 in
*.xml) export NAME=`echo $1 | sed "s/.xml//"` ;;
+ *) OPTS="$OPTS $1" ;;
esac
shift
done
-MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -1`"
+MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -n 1`"
if [ -z "$MOUNT" ]; then
- sh llmount.sh
- MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -1`"
+ sh llmount.sh $OPTS
+ MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -n 1`"
[ -z "$MOUNT" ] && fail "no lustre filesystem mounted" 1
I_MOUNTED="yes"
fi
OSCTMP=`echo $MOUNT | tr "/" "."`
-USED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -1`
+USED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -n 1`
USED=`expr $USED + 16` # Some space for the status file
# let's start slowly here...
# ok, that hopefully worked, so let's do a little more, with files that
# haven't changed in the last day (hopefully they don't change during test)
-FILES=`find $SRC -type f -mtime +1 -ctime +1 | head -$COUNT`
+FILES=`find $SRC -type f -mtime +1 -ctime +1 | head -n $COUNT`
log "copying files from $SRC to $DST$SRC"
tar cf - $FILES | tar xvf - -C $DST || fail "copying $SRC" 11
[ "$ERROR" ] && fail "old and new files are different" $ERROR
sh llmountcleanup.sh || exit 19
-sh llrmount.sh || exit 20
+sh llrmount.sh $OPTS || exit 20
log "comparing previously copied files"
for f in $FILES; do
log "done"
-NOWUSED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -1`
+NOWUSED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -n 1`
if [ `expr $NOWUSED - $USED` -gt 1024 ]; then
echo "Space not all freed: now ${NOWUSED}kB, was ${USED}kB." 1>&2
fi