0

Today I left work with a long running task running in the shell. For the sake of argument let's say I'm using 'wc -l' to count lines in a huge file. I'd like to get a notification when it is done, but I can't rely on email. I want to use curl to trigger an event on some online notification service, which I can then check for from home.

wc -l some_huge_file; curl http://some-notification-service.com

Are there any notification services out there that I could use with curl? I imagine that issuing a GET request to some resource, sets a flag that the job has completed, send an sms, email or whatever.

Any ideas for what to hit with that curl GET/POST/PUT/WHATEVER request?

  • 1
    Can you be more specific? First you said that you cant rely on email, after you said "send an sms, email or whatever" – Marcelo Bittencourt Oct 26 '11 at 19:55
  • Marcelo: I realize that could be confusing. What I mean is that I'm not assuming sendmail to be installed/configured on the system where I'm running the task. The system that receives the GET request could have mail, sms etc features for notification. – Pimin Konstantin Kefaloukos Oct 27 '11 at 08:47

3 Answers3

1

Does it have to be a service?

You can send an SMS message via sendmail.

You can use twitter

You can use Facebook

RobW
  • 2,806
  • 1
  • 19
  • 22
0

I made this simple bash script as a nagios check, to download a file using curl and verify if the contents MD5 matches a provided value...

You can easily modify it to your needs...

https://github.com/mabitt/mab-nagios-plugins/blob/master/check_urlmd5.sh

0

I just notice that:

  • if you want to know your command executed successfully or not, check the exit status with $?.
  • Twitter no longer supports basic authentication. Take a look at Tweepy or Twurl.
quanta
  • 51,413
  • 19
  • 159
  • 217