New answers tagged curl
Some additional help in troubleshooting: Ensure you're listening the right port for the protocol: http=80; https=443 & etc Also curl -v will give the HEADER information for the response server which can be helpful. curl -v --resolve foo.example.com:443:127.0.0.1 https://foo.example.com:443/ ## The client request headers prepended by > > OPTIONS ...
Bash Script that takes one parameter - a filename, and attempts to rename it based on its mime-type using the file command and the system mime.types file: #!/bin/bash # Set the location of your mime-types file here. On some OS X installations, # you may find such a file at /etc/apache2/mime.types; On some linux distros, # it can be found at ...
Add the --max-time option. You may also want to set --connect-timeout which will limit the amount of time that curl tries to connect to the server. Example: curl --output /dev/null --silent --head --fail --max-time 10 --connect-timeout 3 "$url"
I found my answer in the --fail option to curl. By passing this option, curl returns a non-zero exit code for non-200 responses: curl -i -X GET --fail 'http://localhost:9200/_snapshot/s3'
The main difference between running a script on the command line and running it from cron is the environment. If you get different behavior, check if that behavior might be due to environment variables. Cron jobs run with only a few variables set, and those not necessarily to the same value as in a logged-in session (in particular, PATH is often different). ...
Top 50 recent answers are included