title: Exit 1 if log file is not updated in last 5 mins
body: <p>I am trying to add a health check in docker-compose if log file is not updated in last 5 mins then exit.</p>
  <p>Tried solution</p>
  <p>1.</p>
  <pre><code>find /path/to/log/log* -mmin +15 -mmin -30 | xargs -L1 exit1 
  </code></pre>
  <ol start="2">
  <li></li>
  </ol>
  <pre><code>time=`ls -l /usr/home/log/test.log|awk '{ print $8 }'`
  
  sleep 300
  
  time1=`ls -l /usr/home/log/test.log|awk '{ print $8 }'`
   
  if [ $time -eq $time1 ]; then
          exit1
  fi
  </code></pre>
  <p>Above function might work but how I make it work with docker-compose health check. Is there any better option available?</p>
  <pre><code>  test:
      image: alpine
      container_name: alpine
      ports:
        - 8093:8080
      healthcheck:
        test: &lt;some function to check logs file is updating&gt; || exit 1
        interval: 60s
        timeout: 10s
        retries: 3
  </code></pre>