-3

when url is not responding curl command does not give any output/error because of this script does not move to next line. command:

/usr/bin/curl --silent --ntlm --user 'username' --url http://server.net/report --output /home/scripts

Is there any way to exit from url with some error output send to output file? so script will move to next line and it will trigger a alert mail and we will take some action.

1
  • 1
    Maybe you want to set a timeout? You can check the error code to detect this. Have a look at man curl.
    – michas
    Dec 1, 2016 at 14:22

1 Answer 1

1

curl has a --max-time <seconds> option which you can use to avoid the entire operation taking too long.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.