title: How do set cron to run my script every 40mins/25mins?
body: <p>I want a script to run every 40mins beginning on the 40th minute.<br>
  so that means:  </p>
  
  <pre><code>00:40, 01:20, 02:00, 02:40, 03:20...
  </code></pre>
  
  <p>So I made this entry to cron:</p>
  
  <pre><code>*/40 * * * * /path/to/script/foo.sh
  </code></pre>
  
  <p>Unfortunately this runs the script every 40th minute of the hour:  </p>
  
  <pre><code>00:40, 01:40, 02:40...
  </code></pre>
  
  <p>The same goes with the script that I meant to run every 25mins.  </p>
  
  <p>Am I missing something here?  </p>
  
  <hr>
  
  <p><b>ANSWERS</b><br>
  Alright, in case you happen to drop by here having the same problem<br>
  here's how I solved it:</p>
  
  <pre><code># 40mins-interval
  40 0 * * * /path/foo.sh         (0)
  0,40 2-22/2 * * * /path/foo.sh  (2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22)
  20 1-23/2 * * * /path/foo.sh    (1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23)  
  
  
  # 25mins-interval
  25,50 0 * * * /path/foo.sh              (0)
  0,25,50 5-20/5 * * * /path/foo.sh       (5, 10, 15, 20)
  15,40 1-21/5 * * * /path/foo.sh         (1, 6, 11, 16, 21)
  5,30,55 2-22/5 * * * /path/foo.sh       (2, 7, 12, 17, 22)
  20,45 3-23/5 * * * /path/foo.sh         (3, 8, 13, 18, 23)
  10,35 4-19/5 * * * /path/foo.sh         (4, 9, 14, 19)
  </code></pre>
  
  <p>Notes:<br>
  1. There will still be collisions in this schedule (i.e: see schedules that run on the 0th and 10th minutes on both intervals).<br>
  2. The script won't run at an exact interval from its last run today going on the next day (i.e: 25min interval ends @23:45 today, begins @00:25 next day).  </p>