{"id":24998920,"url":"https://github.com/thiswillbeyourgithub/docker_volume_backup","last_synced_at":"2025-08-30T15:24:25.210Z","repository":{"id":269928094,"uuid":"908678772","full_name":"thiswillbeyourgithub/docker_volume_backup","owner":"thiswillbeyourgithub","description":"A ZSH script that automatically backs up Docker container volumes with smart container state handling and rotation of previous backups","archived":false,"fork":false,"pushed_at":"2024-12-28T15:58:56.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T18:52:25.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/thiswillbeyourgithub.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-12-26T17:11:46.000Z","updated_at":"2024-12-30T14:50:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"2fd1277a-673e-4faa-bb23-857e3ce20b4e","html_url":"https://github.com/thiswillbeyourgithub/docker_volume_backup","commit_stats":null,"previous_names":["thiswillbeyourgithub/docker_volume_backup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswillbeyourgithub%2Fdocker_volume_backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswillbeyourgithub%2Fdocker_volume_backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswillbeyourgithub%2Fdocker_volume_backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiswillbeyourgithub%2Fdocker_volume_backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiswillbeyourgithub","download_url":"https://codeload.github.com/thiswillbeyourgithub/docker_volume_backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246223331,"owners_count":20743167,"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":[],"created_at":"2025-02-04T18:52:18.977Z","updated_at":"2025-03-29T18:11:59.833Z","avatar_url":"https://github.com/thiswillbeyourgithub.png","language":"Shell","readme":"# Docker Volume Backup Script\n\nA shell script for safely backing up Docker container volumes. The script automatically handles stopping and restarting containers as needed during the backup process.\n\n## Features\n\n- Automatically stops and restarts containers during backup\n- Creates timestamped backups of all volumes\n- Moves previous backups to trash instead of deleting them\n- Verbose logging option\n- System logging integration\n- Handles multiple volumes per container\n\n## Prerequisites\n\n- Docker\n- sudo access\n- `trash-cli` package for safe file deletion\n- ZSH shell\n\n## Installation\n\n1. Clone this repository\n2. Make the script executable:\n   ```bash\n   chmod +x docker_volume_backup.sh\n   ```\n\n## Usage\n\n```bash\n./docker_volume_backup.sh --output-dir DIR [--verbose] CONTAINER_NAME\n```\n\n### Options\n\n- `--output-dir DIR`: Directory where backups will be stored\n- `--verbose`: Enable verbose logging\n- `CONTAINER_NAME`: Name of the Docker container to backup\n\n### Example\n\n```bash\n./docker_volume_backup.sh --output-dir /path/to/backups --verbose my-container\n```\n\n## Backup Structure\n\nBackups are organized as follows:\n```\noutput-dir/\n└── container-name/\n    └── volume-name/\n        └── YYYYMMDD_HHMMSS.tar.gz\n```\n\n## Error Handling\n\n- Validates container existence and running state\n- Ensures output directory exists\n- Handles backup failures gracefully\n- Automatically restores container state on error\n\n## Logging\n\n- Uses system logger (via `logger`)\n- Optional verbose console output\n- Timestamps all log messages\n\n## License\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiswillbeyourgithub%2Fdocker_volume_backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiswillbeyourgithub%2Fdocker_volume_backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiswillbeyourgithub%2Fdocker_volume_backup/lists"}