3 # sample the first argument to make sure it's not empty.
4 # we can't know if the command is really valid or not, but it at least
5 # needs to not be empty.
8 if [ -z "$test_to_run" ]; then
10 rounder: this script requires a test or program to run as the first parameter.
12 the parameter can be an arbitrarily complex bash command as long as it's
13 escaped properly. for example, this command will check a directory size and
14 then sleep for 10 seconds:
16 rounder '\du -s ~/a_folder_i_watch; sleep 10'
18 rounder will run this check, snoozing in between checks, until the universe
19 ends or something intervenes. note that without the sleep, the check would
20 occur very rapidly and spew output.
25 trashdir="$(mktemp -d "$TMP/rounder.XXXXXX")"
27 echo "Running command: $*"
28 echo "Storing log files in: $trashdir"
33 echo ============================
34 echo round $round commencing
35 outputfile="$trashdir/run_round_${round}.log"
38 eval "${@}" 2>&1 | tee $outputfile
39 if [ ${PIPESTATUS[0]} -ne 0 ]; then
40 echo FAILURE IN RUN $round
43 echo round $round successful.