Skip to content

Bash script that will automatically restart the docker container if exited

Notifications You must be signed in to change notification settings

jeffalgarne/bash-docker-restart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

bash-docker-restart

Bash script that will automatically restart the docker container if exited

How to run the script

Make it executable

chmod +x container-check.sh

Create cron job that runs every minute

echo "* * * * * root /path/container-check.sh" >> /etc/cron.d/container-status-scheck

Note: make sure to change the "path' to the actual path of the script

Restart crond

systemctl restart cron

About

Bash script that will automatically restart the docker container if exited

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages