{"id":17793671,"url":"https://github.com/andyexeter/db-dump","last_synced_at":"2025-09-19T20:49:58.189Z","repository":{"id":77655980,"uuid":"73277491","full_name":"andyexeter/db-dump","owner":"andyexeter","description":"Shell script which dumps a MySQL database and uploads to Google Drive","archived":false,"fork":false,"pushed_at":"2019-02-23T12:34:38.000Z","size":15,"stargazers_count":10,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T00:22:47.545Z","etag":null,"topics":["backup-script","gdrive","google-drive","shell"],"latest_commit_sha":null,"homepage":"","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/andyexeter.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":"2016-11-09T11:18:29.000Z","updated_at":"2023-09-03T00:06:21.000Z","dependencies_parsed_at":"2023-02-28T23:00:41.119Z","dependency_job_id":null,"html_url":"https://github.com/andyexeter/db-dump","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andyexeter/db-dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyexeter%2Fdb-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyexeter%2Fdb-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyexeter%2Fdb-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyexeter%2Fdb-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyexeter","download_url":"https://codeload.github.com/andyexeter/db-dump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyexeter%2Fdb-dump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275998868,"owners_count":25567391,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backup-script","gdrive","google-drive","shell"],"created_at":"2024-10-27T11:11:58.381Z","updated_at":"2025-09-19T20:49:58.160Z","avatar_url":"https://github.com/andyexeter.png","language":"Shell","readme":"# Google Drive MySQL Dumper\n\nSmall script which exports a MySQL database to a file and uploads it to Google Drive.\n\nBy default, the script works on a 14 day retention policy. That is, local and remote backups are kept\nfor up to 14 days, any local backup files the script finds in the backup directory will be gzipped before\nthe newest backup is exported and uploaded.\n\n## Requirements\nRequires the [gdrive](https://github.com/prasmussen/gdrive) command line utility for Google Drive.\n\n## Installation\n1. Download the [gdrive](https://github.com/prasmussen/gdrive)  utility from its GitHub page and follow its installation guide.\n2. Clone this repository\n3. Make the `db-dump.sh` script executable, and link it somewhere it can be called from any directory e.g:\n\n\t```sh\n\t$ chmod +x /path/to/db-dump.sh\n\t$ sudo ln -s /path/to/db-dump.sh /usr/local/bin/db-dump\n\t```\n\t\t\n4. Set up your `db-dump.conf` file, either manually by copying `db-dump.conf.dist`, or by typing `db-dump config` at the command line:\n\n\t```sh\n\t$ db-dump config\n\tGenerating config file...\n\tEnter Database Name: mydatabase    \n\tEnter Google Drive Folder ID: abc123def456\n\tConfig file generated.\n\t```\n\t\t\n5. Run the script\n\n\t```sh\n\t$ db-dump\n\tUploading /var/spool/db-dump/mydatabase-2016-11-09_17:09:51.sql\n\tUploaded 0BwvPrE-VPdlkb7BhLGVJZUxST1z at 356.8 KB/s, total 683.5 KB\n\tDone\n\t```\n\n## Configuration\n\nThe following options must be set and do **not** have default values:\n\n| Option | Description |\n| ------ | ----------- |\n| db_name | Name of the database to export |\n| gdrive_folder_id | Google Drive folder ID where files get uploaded |\n\nThe following options **do** have default values and can be tweaked as desired:\n\n| Option | Description | Default |\n| ------ | ----------- | ------- |\n| date_format | Date format for dates appended to export files | `%Y-%m-%d_%H:%M:%S` |\n| dump_dir | The local directory where export files will be stored | `/var/spool/db-dump` |\n| retention_days | The number of days to retain export files | `14` |\n| mysql_opts | Options to pass to `mysqldump` e.g: \"-uroot\" | (None) |\n\nOptions can be changed in the main `db-dump.conf` file or can be overridden on a per user basis by creating\na config file within your home directory: `$HOME/.config/db-dump.conf`\n\nOptions can also be changed by passing a config file as the first argument to the script. This allows the script to be\nused with different databases and configurations:\n\n```sh\ndb-dump /path/to/my/db-dump.conf\n```\n\n## Automation\nThe easiest way to automatically run the script over a given interval is to link it into one of the\n`/etc/cron.*` directories, e.g:\n\n```sh\nsudo ln -s /path/to/db-dump.sh /etc/cron.daily/db-dump\n```\n\nThe above command will cause the script to be run once every 24 hours.\n\n## License\nReleased under the [MIT license](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyexeter%2Fdb-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyexeter%2Fdb-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyexeter%2Fdb-dump/lists"}