Skip to content

Commit

Permalink
CSPACE-5501: More program flow tweaks to clear_caches script.
Browse files Browse the repository at this point in the history
  • Loading branch information
aronr committed Aug 30, 2012
1 parent c1e3b84 commit 3464f24
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions benchmarks/db-benchmark/clear_caches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ if [ "x$SYNC_PATH" == "x" ];
echo "sync utility could not be found; will not be able to clear Linux disk caches"
exit 1
else
echo "Running sync to write all unsaved cache data to disk ..."
echo "Running sync to attempt to write most unsaved cache data to disk ..."
sync && SYNC_RUN_SUCCESSFULLY=1
fi

if [ $SYNC_RUN_SUCCESSFULLY == 1 ];
then if [ -f /proc/sys/vm/drop_caches ];
if [ $SYNC_RUN_SUCCESSFULLY != 1 ];
then
echo "sync was not run successfully; Linux disk caches were not dropped"
else if [ -f /proc/sys/vm/drop_caches ];
then
echo "Displaying current cache stats ..."
free -m
Expand All @@ -61,8 +63,7 @@ if [ $SYNC_RUN_SUCCESSFULLY == 1 ];
echo "Displaying cache stats after dropping caches ..."
free -m
else
echo "Could not find necessary file to drop Linux disk caches"
exit 1
echo "Could not find drop_caches file; Linux disk caches were not dropped"
fi
fi

Expand Down

0 comments on commit 3464f24

Please sign in to comment.