cronpleskplesk-onyx

Plesk adding a crontask for every minute


I want to have a crontask that executes every minute. However in plesk you can only set a crontask every hour and the minute to execute it.

You can however choose to do this with a workaround. From the Plesk manual I found : https://support.plesk.com/hc/en-us/articles/115004281794-How-to-create-a-scheduled-task-to-fetch-URL-every-15-seconds

And they noted the following code :

for i in {1..4}; do curl --silent "http://example.com" &>/dev/null; sleep 15; done

However I am a bit afraid of using this code. My guess to make a script execute every minute would be like:

for i in {1..4}; do curl --silent "http://example.com/myscript.php" &>/dev/null; sleep 60; done

But what scares me a bit is : /dev/null I am not a unix guru at all but to my knowing /dev/null is the trashbin.

And what does 1..4 do? Looks to me like it repeats itself only 4 times?


Solution

  • -Run a command : Fetch a URL

    -Url : http://example.com/myscript.php

    -Run : Cron Style * * * * *

    Your URL will be fetch every minute