Sort of:
crontab <<'EOF' SHELL=/bin/bash #min hr md mo wkday command */10 * * * * curl 'http://localhost:8983/solr/dataimport?command=full-import' EOF
Use crontab -l to look at it later. BUT, add a parameter to this curl command to put the output somewhere specific, since it can be run somewhere that you do not have write access to. Also, if curl unusual somewhere, you may need to specify its full path, for example /usr/bin/curl , or set the crontab PATH variable.
The quotes around the EOF prevent the HEREIS document from being replaced (all between <<EOF and EOF). HEREIS documents are a shell feature, not part of EOF). HEREIS documents are a shell feature, not part of crontab`.
See man 5 crontab for a detailed description of what happens in crontab files.
Usually I save the ~/.crontab for editing with a special first line, and the execution bit:
This allows me to edit my ~/.crontab and then just run it with:
$ vi ~/.crontab $ ~/.crontab
(I also usually have extensions to indicate which host they are for, e.g. ~ / .crontab.bigbox)
source share