title: PHP SHELL EXEC WITH EXCLUDE
body: <p>This is my current PHP script and it works well except that it backs up everything where in i would like to exclude the image dir.</p>
  
  <pre><code>&lt;?php
  function backup()
   {
    shell_exec("tar -cvf backup`date +%Y%m%d`.tar.gz /home/USERNAME/public_html/WEBSITE.com.au* ");
  }
  
  backup();
  ?&gt;
  </code></pre>
  
  <p>THIS IS WHAT I TRYING TO DO..</p>
  
  <pre><code>&lt;?php
   function backup()
   {
    shell_exec("tar --exclude /home/USERNAME/public_html/WEBSITE.com.au/images/* -cvf backup`date +%Y%m%d`.tar.gz /home/USERNAME/public_html/WEBSITE.com.au/");
   }
  
   backup();
   ?&gt;
  </code></pre>
  
  <p>I am unable to get the exclude function to work. Any ideas how to achieve this?</p>