👁3views
Tip: Using the Watch command to poll a URL

CloudScale AI SEO - Article Summary
  • 1.
    What it is
    The Linux Watch command combined with Curl can repeatedly poll a URL at regular intervals to monitor for changes.
  • 2.
    Why it matters
    This is particularly useful for testing deployments like blue/green switches to ensure there's no downtime during server cutover operations.
  • 3.
    Key takeaway
    Watch + Curl provides a simple way to continuously monitor URL availability during critical deployment operations.

If you want to quickly test a URL for changes, then the linux Watch command couple with Curl is a really simple way to hit a URL every n seconds (I use this for blue/green deployment testing to make sure there is no downtime when cutting over):

# Install watch command using homebrew
brew install watch
# Poll andrewbaker.ninja every 1 seconds
watch -n 1 curl andrewbaker.ninja