Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cronjob every minute

Tags:

I have a file in mysite.com/url1/url2/cronjob.php which has to be run every minute. I try every combination, but can't succeed. What should I run in command line? Thank you.

like image 231
good_evening Avatar asked Feb 04 '11 18:02

good_evening


People also ask

How do I schedule a cron job every minute?

The asterisk (*) operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month. An asterisk in the every field means run given command/script every minute.

How do I run a cron job every 5 minutes?

basic 3. /usr/bin/vim. tiny 4. /bin/ed Choose 1-4 [1]: Make a new line at the bottom of this file and insert the following code. Of course, replace our example script with the command or script you wish to execute, but keep the */5 * * * * part as that is what tells cron to execute our job every 5 minutes.

How do I schedule a cron job every 10 minutes?

Run a Cron Job after every 10 minutes The slash operator helps in writing the easy syntax for running a Cron job after every 10 minutes. In this command, */10 will create a list of minutes after every 10 minutes.

Can you run a cron job every 30 seconds?

But still, you can do some tricky configurations to run your script to run at every 30 seconds. In the above configuration, we have scheduled the script twice. The first cron runs every 1 minute and the second cron also starts at the same time but waits for 30 seconds before execution.


1 Answers

In case you'd set it up in a crontab, this works:

*/1 * * * * /usr/bin/wget -O /dev/null http://example.com/cron.php
like image 191
Linus Kleen Avatar answered Nov 20 '22 01:11

Linus Kleen