title: Create and execute the cron job in PHP
body: <p>There are similar thread, I already went through. They don't clear my doubts please!</p>
  
  <p>refresh.php</p>
  
  <pre><code>&lt;?php
  
  echo "This code will run every minute";
  if(count!=1)
   count+=1;
  else
   $count = 1;
  
  echo $count;
  ?&gt;
  </code></pre>
  
  <p>cron.php</p>
  
  <pre><code>&lt;?php
      exec('echo -e "`crontab -l`\n30 1 * * * /opt/lamt/htdocs/refresh.php" | crontab -'); //to run at 1:30 am        
  ?&gt;
  </code></pre>
  
  <ol>
  <li>How to run this at 10:30 pm ?</li>
  <li>How to execute <code>cron.php</code> ??</li>
  </ol>
  
  <p>Am I going in currect direction?</p>