I want to run this statement:
curl 'http://localhost:8983/solr/dataimport?command=full-import'
every 10 minutes using CRON jobs.
How do I achieve this?
To schedule a curl command to run at 3am daily, you can insert the line: 0 3 * * * curl args... Notice how the minutes and hour correspond to 3am (side note: cron uses 24 hour time format, no am or pm). The asterisks that follow mean every day of month, every month, every day of week.
Cron allows Linux and Unix users to run commands or scripts at a given date and time. You can schedule scripts to be executed periodically. Cron is one of the most useful tool in a Linux or UNIX like operating systems. It is usually used for sysadmin jobs such as backups or cleaning /tmp/ directories and more.
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 .
In case of using Cpanel :
Cpanel->Cron Jobs->Put Time Interval(*/10 * * * * )
Add command in the text box:curl -s "http://localhost:8983/solr/dataimport?command=full-import"
where -s stands for silent (no output)
You are done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With