{"id":22218589,"url":"https://github.com/megahertz/mongo-backup-alpine","last_synced_at":"2026-04-10T20:55:35.685Z","repository":{"id":66074173,"uuid":"123130879","full_name":"megahertz/mongo-backup-alpine","owner":"megahertz","description":"Simple MongoDB backup service in Docker","archived":false,"fork":false,"pushed_at":"2018-04-04T10:56:14.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T19:55:25.451Z","etag":null,"topics":["alpine","backup","docker","mongodb","tools"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/megahertz/mongo-backup-alpine/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/megahertz.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":"2018-02-27T13:11:00.000Z","updated_at":"2023-03-17T12:10:48.000Z","dependencies_parsed_at":"2023-02-20T19:30:50.396Z","dependency_job_id":null,"html_url":"https://github.com/megahertz/mongo-backup-alpine","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Fmongo-backup-alpine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Fmongo-backup-alpine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Fmongo-backup-alpine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Fmongo-backup-alpine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/megahertz","download_url":"https://codeload.github.com/megahertz/mongo-backup-alpine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245415612,"owners_count":20611577,"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":["alpine","backup","docker","mongodb","tools"],"created_at":"2024-12-02T22:27:13.294Z","updated_at":"2026-04-10T20:55:30.655Z","avatar_url":"https://github.com/megahertz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongo-backup-alpine\n\n[![](https://images.microbadger.com/badges/image/megahertz/mongo-backup-alpine.svg)](https://microbadger.com/images/megahertz/mongo-backup-alpine \"Get your own image badge on microbadger.com\")\n\nSimple MongoDB backup service in Docker built on\n[alpine image](https://hub.docker.com/_/alpine/)\nand [Supercronic](https://github.com/aptible/supercronic)\n\n## Usage\n\n### Run the backup service\n```sh\ndocker run -e MONGO_URL=mongodb://host \\\n  -v /backup:/data/backup megahertz/mongo-backup-alpine\n```\n\n#### Volumes\nThe image writes backups to /data/backup, so you need to mount this\npath on a host machine to store backups.\n\n#### Environment variables:\n\nName            | Default               | Description\n----------------|-----------------------|------------\nMONGO_URL       | (required)            | Connection string to MongoDB\nBACKUP_COMMAND  | /usr/local/bin/backup | You can override it to pass mongodump args\nBACKUP_LIFETIME | 10                    | Delete backups older than N days\nBACKUP_PATTERN  | \"+%Y-%m-%d-%H-%M-%S\"  | Pattern for backup name\nBACKUP_SCHEDULE | \"0 4 * * *\"           | How often to make backups, crontab format\n\nBy default, the service makes backup each day at 4am. If you're not\nfamiliar with crontab, you can\n[check the examples](https://crontab.guru/examples.html)\n\n\n### Run using Compose\n\n```yaml\nversion: \"3\"\nservices:\n  mongo:\n    image: mvertes/alpine-mongo:3.4.7-0\n    networks:\n      - mynet\n    restart: always\n    volumes:\n      - ./db:/data/db\n\n  mongo-backup:\n    image: megahertz/mongo-backup-alpine:0.5\n    depends_on:\n      - mongo\n    environment:\n      - MONGO_URL=mongodb://mongo/my_db\n    networks:\n      - mynet\n    restart: always\n    volumes:\n      - ./backup:/data/backup\n\nnetworks:\n  mynet:\n\n```\n\nWith this docker-compose.yml, you can restore the database using:\n\n```sh\ndocker-compose run --rm mongo-backup restore 2018-01-01-00-00-00.gz --drop\n```\n\n## Scripts\n\n### Make backup manually\n\n`backup [mongodump args]`\n\nExample:\n\n```sh\ndocker run -e MONGO_URL=mongodb://host \\\n  -v /backup:/data/backup megahertz/mongo-backup-alpine backup\n```\n\n### Get the list of existing backups\n\n`list`\n\nExample:\n\n```sh\ndocker run -v /backup:/data/backup megahertz/mongo-backup-alpine list\n```\n\n### Restore from backup\n\n`restore BACKUP_FILE [mongorestore args]`\n\nExample:\n\n```sh\ndocker run -e MONGO_URL=mongodb://host \\\n  -v /backup:/data/backup megahertz/mongo-backup-alpine \\\n  restore 2018-02-01-04-00-00.gz --drop\n```\n\n## License\n\nLicensed under MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegahertz%2Fmongo-backup-alpine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegahertz%2Fmongo-backup-alpine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegahertz%2Fmongo-backup-alpine/lists"}