Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRON command to run URL address every 5 minutes

Tags:

php

cron

I'm newbie in cron commands and I need help.

I have a script on http://example.com/check/.

Whats is command for cron to run this URL every 5 minutes?

I tried

*/5 * * * * /home/test/check.php

But I want to run URL not relative script address. How to do it?

like image 250
Mirgorod Avatar asked Jul 07 '12 13:07

Mirgorod


People also ask

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.

What is the use of * * * * * In cron?

It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .

How do I run a cron job every 10 minutes?

For example, 0-23/2 can be used in the hours field to specify command execution every other hour. Steps are also permitted after an asterisk, so if you want to say every two hours just use */2. In this example, */10 in the minutes field to specify command execution every 10 minute.

How do I run a cron job after every minute?

Execute Cron Job After System Reboot. Setup and Run PHP Script As A Cron Job. Run crontab job every minute on a Linux or Unix-like system.


2 Answers

Based on the comments try

*/5 * * * * wget http://example.com/check 

[Edit: 10 Apr 2017]

This answer still seems to be getting a few hits so I thought I'd add a link to a new page I stumbled across which may help create cron commands: https://crontab.guru

like image 162
DilbertDave Avatar answered Sep 28 '22 03:09

DilbertDave


Use cURL:

*/5 * * * * curl http://example.com/check/ 
like image 22
Yan Berk Avatar answered Sep 28 '22 02:09

Yan Berk