The first one will sometimes fail when there are unusual characters in the
password. I'd either use
-u "user:password" (in quotes)
or
-H "Authorization: Basic 98sdfsasdfasdkjwere"
where you're providing the hash of user and password as a Header.

The end of the command just deals with any output.
> /dev/null means no output is recorded, but you'll still get error
messages output
>/dev/null 2>&1 means both output and error messages will be stopped


On Thu, Dec 14, 2023 at 11:35 AM Anuj Bhargava <anujb...@gmail.com> wrote:

> Which of the following is correct or is there a better way?
>
> curl -q http://user:passw...@xxx.xxx.xx.xxx
> :8983/solr/korea/dataimport?command=full-import&clean=true&commit=true
> >/dev/null 2>&1
>
> curl -qsS -u user:password "
>
> http://xxx.xxx.xx.xxx:8983/solr/korea/dataimport?command=full-import&clean=true&commit=true
> "
> > /dev/null
>
> curl -qsS -u user:password "
>
> http://xxx.xxx.xx.xxx:8983/solr/korea/dataimport?command=full-import&clean=true&commit=true
> "
> > /dev/null  2>&1
>
> Regards,
>
> Anuj
>

Reply via email to