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?
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?
Something like:
Use
crontab -l
to get a look at it afterwards. BUT, add an option to thatcurl
command to put the output somewhere specific, since it might be run somewhere to which you don't have write access. Also, ifcurl
is anywhere unusual, you may need to specify its full path, like/usr/bin/curl
, or set thecrontab
PATH variable.The quotes around
EOF
prevent substitution in the contents of the HEREIS document (everything between the<<EOF
andEOF). HEREIS documents are a shell feature, not part of
crontab`.See
man 5 crontab
for a detailed breakdown of what goes in crontab files.I usually keep a
~/.crontab
file to edit with a special first line, and the execute bit set:This lets me edit my
~/.crontab
and then just run it with:(I also usually have extensions on them to indicate which host they're for, like ~/.crontab.bigbox)
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
For blue host and go daddy server: