How to run a cronjob every 2 minutes in a specific hour range
4 answers
If you want to run every two minutes from 10:00 to 12:00, you must use 10-12
instead 10,12
, which means 10:00 and 12:00.
And if you want to run this script, you must
1) Adding php Shebang ( http://www.electrictoolbox.com/php-shebang/ )
2) Make it executable (chmod + x index.php)
- OR -
Specify php interpreter when running ex:
*/2 10-12 * * * php /opt/lampp/htdocs/cron/index.php
+2
source to share