{"id":28364260,"url":"https://github.com/ercindedeoglu/volback","last_synced_at":"2026-03-18T02:24:11.477Z","repository":{"id":279055122,"uuid":"937591892","full_name":"ErcinDedeoglu/volback","owner":"ErcinDedeoglu","description":"Automated Docker volume and database backup to Dropbox with retention policies. Supports MySQL, PostgreSQL, MSSQL, and Qdrant.","archived":false,"fork":false,"pushed_at":"2026-01-28T06:08:27.000Z","size":17277,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v1.0","last_synced_at":"2026-01-28T07:22:37.635Z","etag":null,"topics":["automation","backup","database-backup","devops","docker","docker-volumes","dropbox","golang","mssql","mysql","postgresql","qdrant"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/dublok/volback","language":"Go","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/ErcinDedeoglu.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-23T12:51:52.000Z","updated_at":"2026-01-28T06:08:31.000Z","dependencies_parsed_at":"2026-01-04T19:00:46.982Z","dependency_job_id":null,"html_url":"https://github.com/ErcinDedeoglu/volback","commit_stats":null,"previous_names":["ercindedeoglu/volback"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/ErcinDedeoglu/volback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErcinDedeoglu%2Fvolback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErcinDedeoglu%2Fvolback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErcinDedeoglu%2Fvolback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErcinDedeoglu%2Fvolback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErcinDedeoglu","download_url":"https://codeload.github.com/ErcinDedeoglu/volback/tar.gz/refs/heads/v1.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErcinDedeoglu%2Fvolback/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28886882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation","backup","database-backup","devops","docker","docker-volumes","dropbox","golang","mssql","mysql","postgresql","qdrant"],"created_at":"2025-05-28T20:43:52.254Z","updated_at":"2026-01-29T22:04:22.578Z","avatar_url":"https://github.com/ErcinDedeoglu.png","language":"Go","readme":"# Volback\n\nAutomated backup utility for Docker volumes, host directories, and databases with Dropbox storage and intelligent retention policies.\n\n[![Docker Image](https://img.shields.io/docker/v/dublok/volback?sort=semver\u0026label=Docker%20Hub)](https://hub.docker.com/r/dublok/volback)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n## What It Does\n\nVolback backs up your Docker container volumes, host directories, and databases to Dropbox automatically. It handles the entire backup lifecycle: creating compressed archives, uploading to cloud storage, and cleaning up old backups based on your retention policy.\n\n**Supported Backup Types:**\n- Host directories (any path on the system)\n- Docker container volumes (compressed with 7z)\n- MySQL / MariaDB databases\n- PostgreSQL databases  \n- Microsoft SQL Server databases\n- Qdrant vector database collections\n\n## Quick Start\n\n### One-Time Backup\n\n```bash\ndocker run --rm \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /tmp:/tmp \\\n  -e CONTAINERS='[{\"container\":\"my-app\"}]' \\\n  -e DROPBOX_REFRESH_TOKEN=\"your-refresh-token\" \\\n  -e DROPBOX_CLIENT_ID=\"your-client-id\" \\\n  -e DROPBOX_CLIENT_SECRET=\"your-client-secret\" \\\n  -e DROPBOX_PATH=\"/backups\" \\\n  dublok/volback:latest\n```\n\n### Scheduled Backup (Daily at Midnight)\n\n```bash\ndocker run -d \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /tmp:/tmp \\\n  -e CONTAINERS='[{\"container\":\"my-app\"}]' \\\n  -e DROPBOX_REFRESH_TOKEN=\"your-refresh-token\" \\\n  -e DROPBOX_CLIENT_ID=\"your-client-id\" \\\n  -e DROPBOX_CLIENT_SECRET=\"your-client-secret\" \\\n  -e DROPBOX_PATH=\"/backups\" \\\n  -e CRON_SCHEDULE=\"0 0 * * *\" \\\n  -e KEEP_DAILY=7 \\\n  -e KEEP_WEEKLY=4 \\\n  -e KEEP_MONTHLY=6 \\\n  dublok/volback:latest\n```\n\n## Dropbox Setup\n\nBefore using Volback, you need to create a Dropbox app and obtain OAuth credentials.\n\n### Step 1: Create a Dropbox App\n\n1. Go to [Dropbox App Console](https://www.dropbox.com/developers/apps)\n2. Click **Create app**\n3. Choose **Scoped access**\n4. Choose **Full Dropbox** or **App folder** (depending on your preference)\n5. Name your app (e.g., \"volback\")\n6. Click **Create app**\n\n### Step 2: Configure Permissions\n\n1. Go to the **Permissions** tab\n2. Enable these permissions:\n   - `files.content.write`\n   - `files.content.read`\n3. Click **Submit**\n\n### Step 3: Generate Refresh Token\n\n1. Go to the **Settings** tab\n2. Note your **App key** (this is your `DROPBOX_CLIENT_ID`)\n3. Note your **App secret** (this is your `DROPBOX_CLIENT_SECRET`)\n4. Under **OAuth 2**, set **Access token expiration** to **No expiration** if available, or use refresh tokens\n5. Generate a refresh token using the OAuth flow or [Dropbox OAuth Guide](https://developers.dropbox.com/oauth-guide)\n\n## Configuration\n\nAll configuration is done via environment variables.\n\n### Required Variables\n\n| Variable | Description |\n|----------|-------------|\n| `DROPBOX_REFRESH_TOKEN` | OAuth refresh token from your Dropbox app |\n| `DROPBOX_CLIENT_ID` | App key from your Dropbox app |\n| `DROPBOX_CLIENT_SECRET` | App secret from your Dropbox app |\n| `DROPBOX_PATH` | Destination folder in Dropbox (e.g., `/backups`) |\n\n### Backup Targets\n\nAt least one backup target must be configured. All targets use JSON array format.\n\n#### Docker Containers\n\n```bash\nCONTAINERS='[\n  {\"container\": \"my-app\"},\n  {\"container\": \"nginx\", \"stop\": true},\n  {\"container\": \"postgres\", \"backup_id\": \"db-server\", \"depends_on\": [\"my-app\"]}\n]'\n```\n\n| Field | Type | Required | Default | Description |\n|-------|------|----------|---------|-------------|\n| `container` | string | Yes | - | Container name |\n| `stop` | boolean | No | `false` | Stop container during backup |\n| `backup_id` | string | No | container name | Custom identifier for backup folder |\n| `include_ro` | boolean | No | `false` | Include read-only volumes |\n| `depends_on` | array | No | `[]` | Process these containers first |\n\n#### MySQL / MariaDB\n\n```bash\nMYSQL='[\n  {\n    \"container\": \"mysql\",\n    \"user\": \"root\",\n    \"password\": \"secret\",\n    \"databases\": [\"app_db\", \"analytics\"]\n  }\n]'\n```\n\n| Field | Type | Required | Default | Description |\n|-------|------|----------|---------|-------------|\n| `container` | string | Yes | - | MySQL container name |\n| `user` | string | Yes | - | Database user |\n| `password` | string | Yes | - | Database password |\n| `databases` | array | Yes | - | List of databases to backup |\n| `port` | integer | No | `3306` | MySQL port |\n| `backup_id` | string | No | container name | Custom backup folder name |\n\n#### PostgreSQL\n\n```bash\nPOSTGRESQL='[\n  {\n    \"container\": \"postgres\",\n    \"user\": \"postgres\",\n    \"password\": \"secret\",\n    \"databases\": [\"mydb\"]\n  }\n]'\n```\n\n| Field | Type | Required | Default | Description |\n|-------|------|----------|---------|-------------|\n| `container` | string | Yes | - | PostgreSQL container name |\n| `user` | string | Yes | - | Database user |\n| `password` | string | Yes | - | Database password |\n| `databases` | array | Yes | - | List of databases to backup |\n| `port` | integer | No | `5432` | PostgreSQL port |\n| `backup_id` | string | No | container name | Custom backup folder name |\n\n#### Microsoft SQL Server\n\n```bash\nMSSQL='[\n  {\n    \"host\": \"mssql-server\",\n    \"user\": \"sa\",\n    \"password\": \"YourStrong!Passw0rd\",\n    \"databases\": [\"master\", \"app_db\"]\n  }\n]'\n```\n\n| Field | Type | Required | Default | Description |\n|-------|------|----------|---------|-------------|\n| `host` | string | Yes | - | SQL Server hostname |\n| `user` | string | Yes | - | Database user |\n| `password` | string | Yes | - | Database password |\n| `databases` | array | Yes | - | List of databases to backup |\n| `port` | integer | No | `1433` | SQL Server port |\n| `backup_id` | string | No | host name | Custom backup folder name |\n\n#### Qdrant Vector Database\n\n```bash\nQDRANT='[\n  {\n    \"host\": \"qdrant\",\n    \"port\": 6333,\n    \"collections\": [\"embeddings\", \"documents\"]\n  }\n]'\n```\n\n| Field | Type | Required | Default | Description |\n|-------|------|----------|---------|-------------|\n| `host` | string | Yes | - | Qdrant hostname |\n| `collections` | array | Yes | - | List of collections to backup |\n| `port` | integer | No | `6333` | Qdrant HTTP port |\n| `api_key` | string | No | - | API key if authentication is enabled |\n| `backup_id` | string | No | host name | Custom backup folder name |\n\n#### Host Paths\n\nBackup any directory on the host system directly, without needing a Docker container.\n\n```bash\nPATHS='[\n  {\"path\": \"/home/user/data\"},\n  {\"path\": \"/etc/myapp\", \"backup_id\": \"myapp-config\"},\n  {\"path\": \"/var/lib/important\"}\n]'\n```\n\n| Field | Type | Required | Default | Description |\n|-------|------|----------|---------|-------------|\n| `path` | string | Yes | - | Absolute path to backup |\n| `backup_id` | string | No | directory name | Custom backup folder name |\n\n**Note:** When using `PATHS`, mount the directories into the container:\n\n```bash\ndocker run --rm \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /tmp:/tmp \\\n  -v /home/user/data:/home/user/data:ro \\\n  -e PATHS='[{\"path\": \"/home/user/data\", \"backup_id\": \"my-data\"}]' \\\n  -e DROPBOX_REFRESH_TOKEN=\"...\" \\\n  -e DROPBOX_CLIENT_ID=\"...\" \\\n  -e DROPBOX_CLIENT_SECRET=\"...\" \\\n  -e DROPBOX_PATH=\"/backups\" \\\n  dublok/volback:latest\n```\n\n### Retention Policy\n\nControl how many backups to keep. Volback automatically deletes old backups that exceed these limits.\n\n| Variable | Description |\n|----------|-------------|\n| `KEEP_DAILY` | Number of daily backups to retain |\n| `KEEP_WEEKLY` | Number of weekly backups to retain |\n| `KEEP_MONTHLY` | Number of monthly backups to retain |\n| `KEEP_YEARLY` | Number of yearly backups to retain |\n\n**How it works:**\n- The most recent backup is always kept\n- One backup per day/week/month/year is retained (the oldest in each period)\n- Backups outside these windows are deleted\n\n**Example:** With `KEEP_DAILY=7, KEEP_WEEKLY=4, KEEP_MONTHLY=6`:\n- Keep backups from the last 7 different days\n- Keep 4 weekly backups (one per week)\n- Keep 6 monthly backups (one per month)\n\n### Scheduling\n\n| Variable | Description |\n|----------|-------------|\n| `CRON_SCHEDULE` | Cron expression for scheduled backups |\n\nIf `CRON_SCHEDULE` is set, Volback runs as a daemon and executes backups on schedule. If not set, it runs once and exits.\n\n**Common schedules:**\n- `0 0 * * *` - Daily at midnight\n- `0 */6 * * *` - Every 6 hours\n- `0 2 * * 0` - Weekly on Sunday at 2 AM\n- `30 1 1 * *` - Monthly on the 1st at 1:30 AM\n\n## Docker Compose Example\n\n```yaml\nservices:\n  volback:\n    image: dublok/volback:latest\n    container_name: volback\n    restart: unless-stopped\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n      - /tmp:/tmp\n    environment:\n      # Dropbox credentials\n      DROPBOX_REFRESH_TOKEN: ${DROPBOX_REFRESH_TOKEN}\n      DROPBOX_CLIENT_ID: ${DROPBOX_CLIENT_ID}\n      DROPBOX_CLIENT_SECRET: ${DROPBOX_CLIENT_SECRET}\n      DROPBOX_PATH: /backups/myserver\n      \n      # Schedule (daily at 3 AM)\n      CRON_SCHEDULE: \"0 3 * * *\"\n      \n      # Retention\n      KEEP_DAILY: 7\n      KEEP_WEEKLY: 4\n      KEEP_MONTHLY: 12\n      KEEP_YEARLY: 2\n      \n      # Backup targets\n      CONTAINERS: |\n        [\n          {\"container\": \"app\", \"stop\": true},\n          {\"container\": \"redis\"}\n        ]\n      MYSQL: |\n        [\n          {\n            \"container\": \"mysql\",\n            \"user\": \"root\",\n            \"password\": \"${MYSQL_ROOT_PASSWORD}\",\n            \"databases\": [\"app_production\"]\n          }\n        ]\n```\n\n## Architecture\n\n```\n┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐\n│  Docker Host    │     │    Volback      │     │    Dropbox      │\n│                 │     │                 │     │                 │\n│  ┌───────────┐  │     │  1. Stop        │     │  ┌───────────┐  │\n│  │ Container │◄─┼─────┼─────────────────┼─────┼─►│ /backups  │  │\n│  └───────────┘  │     │  2. Backup      │     │  │  /app     │  │\n│  ┌───────────┐  │     │  3. Compress    │     │  │  /mysql   │  │\n│  │  Volumes  │◄─┼─────┼─────────────────┼─────┼─►│  /...     │  │\n│  └───────────┘  │     │  4. Upload      │     │  └───────────┘  │\n│  ┌───────────┐  │     │  5. Start       │     │                 │\n│  │ Database  │◄─┼─────┼─────────────────┼─────┼─►  Retention    │\n│  └───────────┘  │     │  6. Cleanup     │     │   Management    │\n└─────────────────┘     └─────────────────┘     └─────────────────┘\n```\n\n## Backup File Structure\n\nBackups are organized in Dropbox by backup ID and timestamped:\n\n```\n/backups/\n├── my-app/\n│   ├── 20260127.030000.7z\n│   ├── 20260126.030000.7z\n│   └── 20260125.030000.7z\n├── my-data/\n│   ├── 20260127.030000.7z\n│   └── 20260126.030000.7z\n├── mysql/\n│   ├── app_db/\n│   │   ├── 20260127.030000.sql\n│   │   └── 20260126.030000.sql\n│   └── analytics/\n│       └── 20260127.030000.sql\n└── postgres/\n    └── mydb/\n        └── 20260127.030000.sql\n```\n\n## Troubleshooting\n\n### Backup fails with \"Dropbox configuration is required\"\nEnsure all three Dropbox variables are set: `DROPBOX_REFRESH_TOKEN`, `DROPBOX_CLIENT_ID`, and `DROPBOX_CLIENT_SECRET`.\n\n### Container not found\nMake sure the container name matches exactly (case-sensitive) and the container exists on the Docker host.\n\n### Permission denied errors\nThe Docker socket must be mounted: `-v /var/run/docker.sock:/var/run/docker.sock`\n\n### Large files fail to upload\nFiles over 150MB use chunked uploads automatically. Ensure stable network connectivity.\n\n### Scheduled backup not running\nCheck container logs: `docker logs volback`. Verify the cron expression is valid.\n\n## Requirements\n\n- Docker 19.03+\n- Dropbox account with API access\n- Network access to Dropbox API endpoints\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fercindedeoglu%2Fvolback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fercindedeoglu%2Fvolback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fercindedeoglu%2Fvolback/lists"}