Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make cron job every day at 6 O'clock by Cpanel

Tags:

php

cron

how to make cron job every day at 6 O'clock by Cpanel ? I added cron job by my cpanel as this picture

http://i.imgur.com/vc1iv.jpg

But the script work more one time in the day , I need to know the error in cron or in my script .

like image 298
samino sami Avatar asked Sep 13 '12 08:09

samino sami


People also ask

How do I run a cron job at a specific time?

Every minute: if you want to run a cronjob every minute then you would use the wild card symbol * . If however you wanted to run it every x minutes you would use */x for example every 5 minutes would be */5 or for every 15 minutes */15 . The next option is to specify the minutes separated by , for example 3,16,23,48 .


1 Answers

Your cron will run every minute at 6 o'clock, because of that asterisk.

Cron format:

* * * * * *
| | | | | | 
| | | | | +-- Year              (range: 1900-3000)
| | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)
Any of these 6 fields may be an asterisk (*). 
This would mean the entire range of possible values, i.e. each minute, each hour, etc.

You should put minute 0 because you need to run it just once (at 06:00).

0 6 * * * 
like image 131
Mihai Iorga Avatar answered Oct 15 '22 06:10

Mihai Iorga