title: How can i know if a command exection is completed and notify in case of an error or not?
body: <p>I am running a command that creates a zip file in my php controller script.
  Once the file is created, an email is been send to a user for notification. The command is as follows :
  <code>system("7za a path/zip_file -mem=AES256 -v2g -mx9 -pPassword path/zipcontent &gt; /dev/null 2&gt;&amp;1 &amp;");</code></p>
  
  <p>The creation of the zip file last for about 20 minutes and I wish to send the email once the file is created completely (that is after the 20 minutes) or if an error occur notify the user of the error.</p>
  
  <p>How can I do to know if the execution of the command is completed and file well created before sending the mail in case of an error or not?</p>
  
  <p>Thanks in advance.</p>