V
V
Vitaly Gavrilov2017-05-08 12:11:08
Task Schedulers
Vitaly Gavrilov, 2017-05-08 12:11:08

How to build a cron command correctly?

Good afternoon. Tell me please. I have a script located at the root of my site. The question is how to properly build a cron command so that it automatically opens every 5 minutes? No matter how I try, it doesn’t work ...
This is how it is indicated in VestaCP

sudo /home/admin/web/site.com/public_html/vkcover/VKcover.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shaher Oqaili, 2017-05-08
@promychev

I don’t know about VESTA, but I can give an example of a manual config.
Let's say the example.sh script sits in the /home/ directory
so that it runs every minute, you need to go to ssh and write the crontab -e command,
select the nano editor according to the standard and go to the last line.
In order for the script to run every 5 minutes, you need to write the following:
*/5 * * * * /home/example.sh so
that every 5 hours you need to write the following:
* */5 * * * /home/example.sh
Every 5 days :
* * */5 * * /home/example.sh
every 5 months :
* * * * */5 /home/example.sh
Then crtl + x and save

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question