add a +x to the first line &quot;#!/bin/bash -x&quot; and run the script.<br><br><div class="gmail_quote">On Tue, Jan 4, 2011 at 6:40 PM, Raymond Norton <span dir="ltr">&lt;<a href="mailto:admin@lctn.org">admin@lctn.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">That did not do the trick.<br>
<br>
This is the script: (It does not seem to execute, but cron shows it ran.<br>
The backup script works fine via cron, but does not get executed when<br>
called from this script)<br>
<div class="im"><br>
#!/bin/bash<br>
<br>
HOST=&quot;windowshostname&quot;<br>
<br>
CMD=&quot;ping -c1 $HOST&quot;<br>
CMD_RET=`$CMD`<br>
# echo $CMD_RET<br>
NOWDATE=`date +%Y%m%d`<br>
<br>
if [ -f ping_check.txt ];<br>
then<br>
      FILEDATE=`cat ping_check.txt`<br>
else<br>
      FILEDATE=0<br>
fi<br>
<br>
if [ $NOWDATE -ne $FILEDATE ];<br>
then<br>
      if [[ $CMD_RET =~ &quot;, 0% packet loss&quot; ]]<br>
      then<br>
           echo &quot;$HOST pinged ...&quot;<br>
           echo $NOWDATE &gt; ping_check.txt<br>
         # run backup script<br>
      else<br>
           echo &quot;$HOST did not ping ...&quot;<br>
      fi<br>
fi<br>
<br>
exit<br>
<br>
<br>
<br>
</div><div><div></div><div class="h5">On 01/04/2011 04:24 PM, Smith, Craig A wrote:<br>
&gt; Raymond Norton wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; I tried appending&gt;  /dev/null, but can&#39;t get it to run like it does from the command line.<br>
&gt;&gt;<br>
&gt;<br>
&gt; Does it send an annoying email every time it runs?<br>
&gt;<br>
&gt; If so, try adding  \;&gt;  /dev/null  2&gt;&amp;1<br>
&gt; to the end of crontab entry.<br>
&gt;<br>
&gt; For example:<br>
&gt;<br>
&gt; 1-59/10 * * * *  /path-to-script/scrip.sh  \;&gt;  /dev/null  2&gt;&amp;1<br>
&gt;<br>
&gt; will silently run the script every 10min.<br>
&gt; _______________________________________________<br>
&gt; TCLUG Mailing List - Minneapolis/St. Paul, Minnesota<br>
&gt; <a href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a><br>
&gt; <a href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list" target="_blank">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a><br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota<br>
<a href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a><br>
<a href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list" target="_blank">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><font color="#888888"><div>“Twenty years from now you will be more 
disappointed by the things that you didn’t do than by the ones you did 
do. So throw off the bowlines. Sail away from the safe harbor. Catch the
 trade winds in your sails. Explore. Dream. Discover.”</div>
<div>– Mark Twain</div></font></div><br>