Grep Timer

Grep can be used as a timer, and can be blocking. This will block until the logs print accept connections twice, or 500 seconds elapses, with an return code to match. Good for blocking a CD pipeline until a certain log has been output. ( docker compose logs postgres -f & ) | timeout 500 grep -m2 "accept connections" I came across this when using initdb.d with Docker and Postgres . initdb.d will…