Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save svenhornberg/9b36e788a94acc5ac57891c3332927ed to your computer and use it in GitHub Desktop.
Save svenhornberg/9b36e788a94acc5ac57891c3332927ed to your computer and use it in GitHub Desktop.
zalenium kill after a hour
#!/bin/bash
while :
do
echo "checking for idle container"
docker ps --format '{{.ID}}\t{{.Image}}\t{{.Status}}\t{{.RunningFor}}' -f name='zalenium_' | grep -i hour | cut -f 1 | xargs docker stop
sleep 600 #10 min
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment