Reputation: 67
I want to write a script that checks if an application is running every 5 minutes or so. If it not is running I want to execute an URL with a php-file with parameters (username, password, message) in the background. My plan is to fetch the parameters in the URL on the server and do something with that information, e.g write to a database or a file on the server, so that I can collect statistics to show in a back-end system.
So how do I execute that URL through a shell script in OS X?
Cheers!
Question was only about how to execute the URL without launching a browser etc.
But perhaps a better solution is to connect and write directly to a database?
Upvotes: 0
Views: 365
Reputation: 207385
Not sure if your question is really about how to get the script run every 5 minutes, or how to write the script, or how to grab some data from a web-server, or how to process that. Glenn's answer has some of it covered. The "running every 5 minutes" part is probably best addressed through using the launchctl utility. See here.
Maybe you could expand your description of what it is you want to know...
Upvotes: 0
Reputation: 246744
probably
output=$(curl -o- "http://example.com/path?userid=foo&...")
Upvotes: 1