4 ms·
Can you give an example where a shell script would solve the problem? Curious to know
by ismail-khan 10y ago
Can you give an example where a shell script would solve the problem? Curious to know
- majewsky 10y agoLast month, I needed to add a periodic job to a simple Rails app to snapshot some data and send it to another system. I discussed the design with a colleague, a Rails expert, who went into the pros and cons of various worker-queue configurations. In the end, I added a hidden API call, and deployed a shell script along the lines of while true; do curl https://rails.app/do/the/thing sleep 3600 done The actual version is slightly larger because of error checking etc., but that's the gist. So that's one example of replacing (or rather: avoiding) a distributed system (an asynchronous job queue) with a small shell script. I don't mean to say that shell scripts always can replace more complex systems, but sometimes they're enough.