File: [Development] / xfs-cmds / xfstests / run.tar (download)
Revision 1.8, Thu Nov 14 03:39:42 2002 UTC (14 years, 11 months ago) by fsgqa
Branch: MAIN
CVS Tags: XFS-1_3_0pre1 Changes since 1.7: +1 -1
lines
Very minor fixups.
Very minor fixups.
|
#!/bin/sh
#
# Produces a .tar file (if one doesn't exist as $TARFILE), then
# times how long it takes to untar it onto the current directory.
#
TARFILE=${TARFILE:=/var/tmp/bench.tar.gz}
barf()
{
echo $@ >2
exit 1
}
new_tar()
{
source="bin sbin lib"
if [ ! -f $TARFILE ]; then
( cd / && tar czf $TARFILE $source ) || barf "tar cz failed"
fi
}
run_tar()
{
# %U=user %S=system %E=elapsed
mkdir ./tar || exit 1
size=`ls -Llh $TARFILE | awk '{print $5}'`
time=`/usr/bin/time -f '%U,%S,%E' tar xzf $TARFILE 2>&1`
status=$?
cd ..
rm -fr ./tar
[ $status -eq 0 ] || exit 1
echo "$size,$time"
}
if [ $# -gt 0 ]; then
echo "sz,usr,sys,real"
exit 0
fi
new_tar
run_tar