title: how to execute ".sh" file from wordpress plugin?
body: <p>I am writing a plugin for my client to run a sync for their products on that website.
  This sync file is basically a .sh file to take backup for existing database.
  In this wordpress plugin I have created simple button which submits the form which looks like below.</p>
  
  <pre><code>       &lt;?php
         if(isset($_POST['cmdsync']))
         {
           echo exec("/home/trgt/webs/www.mywebsite.co.uk/zenlo_scripts/sync_vend_to_shopp.sh");
         }
         ?&gt;
         &lt;h2&gt;Start syncing products from VEND to Shopp:&lt;/h2&gt;
         &lt;form action='#' method='post'&gt;
             &lt;input id="cmdsync" name="cmdsync" value="SYNC" type="submit" /&gt;
         &lt;/form&gt;
  </code></pre>
  
  <p>The problem I am facing is the exec function is not doing anything not even creating a backup or echoing the return value. 
  Can anyone help me how can i execute .sh script file from wordpress backend plugin interface?</p>
  
  <p>The .sh looks like</p>
  
  <p>!/</p>
  
  <pre><code>opt/local/bin/bash
  
  DATE=`date`
  cd /home/trgt/webs/www.mywebsite.co.uk/zenlo_scripts
  /opt/local/bin/find db_backups -mtime +100 -name "trgt*.sql.gz" -delete
  mysqldump -utrgt -p'password' DB_NAME | gzip -9 &gt; "db_backups/trgt_tr_shopp_wp.backup.$DATE.sql.gz"
  </code></pre>