title: file conversion every after 10 minutes cronjob
body: <p>I have added a cron job to execute a script after every 10 minutes , the script checks if the any new file is uploaded to directory, if there is a new file then it converts the video file to a small size like i have given in the command ..</p>
  
  <p>Below is the code i have tried , everything is working , i tried adding the email functionality as well and it works, but not executing ffmpeg command</p>
  
  <pre><code>$last = (int)file_get_contents('timestamp.txt');
  file_put_contents('timestamp.txt', time());
  $files = glob('videos/*.mp4');
  $files = array_filter($files, function($file) { 
      return filemtime($file) &gt; $last; 
  });
  
  if ($files) {
      foreach ($files as $sfile) {
          $sfile = str_replace('videos/', '', $sfile);
          $video = 'videos/'.escapeshellcmd($sfile);
          $sixty = "videos/250/".escapeshellcmd($sfile);
          $cmdform = "ffmpeg -i $video -vf scale=250:140 $sixty";
          $do = `$cmdform`;
      }
  }
  </code></pre>
  
  <p>One more thing is that it converts the files with static name  like if i give "videos/1.mp4" then it works but does not work in foreach loop.</p>
  
  <p>and command to set cron job </p>
  
  <pre><code>*/10 * * * * wget http://mywebsite.com/coding.php
  </code></pre>
  
  <p>Much thanks. </p>