{"id":17693894,"url":"https://github.com/mr-ingenious/docker-backup-script","last_synced_at":"2026-04-28T08:34:29.528Z","repository":{"id":234918877,"uuid":"789735108","full_name":"mr-ingenious/docker-backup-script","owner":"mr-ingenious","description":"Simple Docker volumes backup script ","archived":false,"fork":false,"pushed_at":"2024-04-22T17:55:25.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T04:51:12.204Z","etag":null,"topics":["backup","docker","script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mr-ingenious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-21T12:16:01.000Z","updated_at":"2024-04-22T17:55:29.000Z","dependencies_parsed_at":"2024-04-22T19:09:43.887Z","dependency_job_id":"c6fe7c6b-123d-4e0a-ada9-0834b09bcdbf","html_url":"https://github.com/mr-ingenious/docker-backup-script","commit_stats":null,"previous_names":["mr-ingenious/docker-backup-script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-ingenious%2Fdocker-backup-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-ingenious%2Fdocker-backup-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-ingenious%2Fdocker-backup-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-ingenious%2Fdocker-backup-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mr-ingenious","download_url":"https://codeload.github.com/mr-ingenious/docker-backup-script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246392158,"owners_count":20769694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","docker","script"],"created_at":"2024-10-24T13:47:19.603Z","updated_at":"2026-04-28T08:34:22.062Z","avatar_url":"https://github.com/mr-ingenious.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-backup-script\nSimple Docker volumes backup tool\n\n## Introduction\nThis script queries the available docker containers on a machine, stops them, creates backups of their volumes and starts the containers again.\n\n## Prerequisites\nThe script relies on ``jq``, ``gzip``, ``curl`` and ``tar``. It can send notifications to a Gotify server.\n\n## Usage\n\n```\n./backup_docker.sh [options]\n\nUsage examples:\n       ./backup_docker.sh --help\n       ./backup_docker.sh --template\n       ./backup_docker.sh --backup /home/user/backup_config.json\n\nOptions:\n  -h, --help\n         print this help and exit\n\n  -t, --template\n         print a backup config template structure with locally found docker containers\n\n  -b config, --backup config\n         perform backup with configuration\n```\n\n## Setting up everything\n### Generating an initial configuration\nAn initial configuration can be automatically generated by invoking the script with the option ``-b \u003cconfigfile\u003e``. The configuration must be edited to specify\n\n* the backup base directory (output of the script containing the backup zips),\n* the different storage directories (input for the script)\n* additionally, the notification section that allows the script to report the results. Possible options are gotify and console output\n\n```\n{\n  \"created\": \"2024-04-21 14:35:02\",\n  \"backup_base_dir\": \"/home/user/docker/backups\",\n  \"backup_items\": [\n    {\n      \"name\": \"heimdall\",\n      \"id\": \"1153e2a7b0c6\",\n      \"image\": \"lscr.io/linuxserver/heimdall:latest\",\n      \"state\": \"running\",\n      \"storage_dir\": \"/home/user/docker/heimdall/volume\"\n    },\n\n...\n\n],\n  \"notification\": {\n    \"type\": \"gotify\",\n    \"url\": \"http://my-gotify-server:88\",\n    \"token\": \"mytoken\"\n  }\n}\n```\n\nINFORMATION: Please note that the script must be run as root as it calls docker for controlling the starting, stopping and querying the docker containers.\n\n### Automatic task\nThe script can be placed anywhere in the file system. It can be invoked at given times / cycles with a cronjob, see example below.\n\nThis configuration starts a backup every day at 01:00 o'clock:\n\n```\n0 1 * * * /bin/bash /home/user/scripts/backup_docker.sh -b /home/user/scripts/backup_config.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-ingenious%2Fdocker-backup-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-ingenious%2Fdocker-backup-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-ingenious%2Fdocker-backup-script/lists"}