Note that there are some explanatory texts on larger screens.

plurals
  1. POTiming Asynchronous Tasks in Shell Script
    primarykey
    data
    text
    <p>Basically I am trying to write a script to stress test my server and ensure a command is running. My script is not working as intended. Below is the script. Basically the commands the script is executing are not being run asynchronously nor are their output being written to the results file. Any suggestions?</p> <pre><code>#Script to load test the swift command on a linux box numOfTests=100 echo "Starting Swift Load Tester ($numOfTests iterations)" mkdir /srv/www/htdocs/audiotest/stress_test mkdir /srv/www/htdocs/audiotest/half_sec_test mkdir /srv/www/htdocs/audiotest/sec_test echo "This is the prompt text" &gt; /srv/www/htdocs/audiotest/prompt.txt echo "Beginning Stress Test..." #Clear results text file echo "" &gt; results.txt for((i=0; i &lt; numOfTests; i++)) do (time /opt/swift/bin/swift -n Allison-8kHz -o /srv/www/htdocs/audiotest/stress_test/$i.wav -f /srv/www/htdocs/audiotest/prompt.txt &amp;) &gt;&gt; results.txt 2&gt;&amp;1 done echo "Done" echo "Beginning 1/2 second interval test..." for((i=0; i&lt; numOfTests; i++)) do (time /opt/swift/bin/swift -n Allison-8kHz -o /srv/www/htdocs/audiotest/half_sec_test/$i.wav -f /srv/www/htdocs/audiotest/prompt.txt &amp;) &gt;&gt; results.txt 2&gt;&amp;1 sleep .5 done echo "Done" echo "Beginning 1 second interval test..." for((i=0; i&lt; numOfTests; i++)) do (time /opt/swift/bin/swift -n Allison-8kHz -o /srv/www/htdocs/audiotest/sec_test/$i.wav -f /srv/www/htdocs/audiotest/prompt.txt &amp;) &gt;&gt; results.txt 2&gt;&amp;1 sleep 1 done echo "Done" echo "Load Testing Completed" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload