Enabling Backups For Docker Containers - Appsembler

Enabling Backups For Docker Containers

Very simple process. We should probably further automate it in the future.

  1. SSH to the docker server
  2. Collect the IDs of all running containers and send to file containers.txt 
    • run: docker ps -q > containers.txt
    • From there you can manually include/exclude other container IDs
    • Running this against a container that a customer is testing isn’t necessarily a bad thing. 
  3. Run the enable_backups.sh script

The script reads the containers.txt file, and one by one, sshes into each container, copies in the backup script, and sets a cron job to run the backup nightly. Running this script against a container that already has backups enabled doesn’t do anything bad.


  • automate this process a bit more (possibly create a cron job on the docker-server that runs the above steps)
  • automatically delete old db archives. this is a manual process for the time being.