{"id":23444854,"url":"https://github.com/webmasterish/mysql_backup","last_synced_at":"2025-04-09T23:28:20.757Z","repository":{"id":223650087,"uuid":"760825055","full_name":"webmasterish/mysql_backup","owner":"webmasterish","description":"MySQL Backup Script","archived":false,"fork":false,"pushed_at":"2024-02-21T17:08:25.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T14:53:06.813Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmasterish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-20T20:28:29.000Z","updated_at":"2024-02-21T09:04:04.000Z","dependencies_parsed_at":"2024-02-21T11:26:04.118Z","dependency_job_id":"cc17268f-98a9-4f9c-a89b-181f1dc61e41","html_url":"https://github.com/webmasterish/mysql_backup","commit_stats":null,"previous_names":["webmasterish/mysql_backup"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fmysql_backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fmysql_backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fmysql_backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fmysql_backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterish","download_url":"https://codeload.github.com/webmasterish/mysql_backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248128501,"owners_count":21052420,"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":"2024-12-23T19:19:27.582Z","updated_at":"2025-04-09T23:28:20.732Z","avatar_url":"https://github.com/webmasterish.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MySQL Backup Script\n\nThe MySQL Backup Script is a Bash script designed to simplify the process of backing up MySQL databases. It provides a flexible solution for both manual backups through the command line interface (CLI) and automated backups via cron jobs. The script allows users to specify configuration parameters such as the backup directory, MySQL credentials, and retention policy, making it easy to adapt to various backup requirements. With its ability to compress backups and remove old backups based on a specified time frame, the MySQL Backup Script offers a robust and efficient solution for MySQL database backups.\n\n\n## Usage\n\nThis script can be used both from the command line interface (CLI) and as a cron job.\n\n### CLI\n\nTo execute the script from the command line interface:\n\n```bash\n\nbash mysql_backup.sh\n\n# or\n\n./mysql_backup.sh\n\n```\n\n### Cron Job\n\nTo schedule the script as a cron job, add the following line to your crontab:\n\n```bash\n\n# open crontab\ncrontab -e\n\n# add the following wich will execute the script daily at 2:00 AM\n# adjust the timing according to your requirements.\n0 2 * * * /path/to/mysql_backup.sh \u003e/dev/null 2\u003e\u00261\n\n```\n\nMake sure to replace `/path/to/mysql_backup.sh` with the actual path to the script file.\n\nBefore running the script, ensure that you have set up the required configuration in the `mysql_backup.config` file. If this file is not present in the same directory as the script, make sure to provide its path as an argument when executing the script:\n\n```bash\n\nbash mysql_backup.sh /path/to/mysql_backup.config\n\n```\n\n### Configuration\n\nThe script requires a configuration file named `mysql_backup.config` to be present in the same directory. You can also specify the path to a different configuration file as an argument when executing the script from the command line.\n\nRefer to the `mysql_backup.config.example` file for the required configuration parameters.\n\n```bash\n\n# required\nBACKUP_DIR=\"/path/to/mysql/backups\"\nMYSQL_USER=\"mysql_username\"\nMYSQL_PASS=\"mysql_password\"\nMYSQL_HOST=\"mysql_host\"\n\n# optional\nSINGLE_BACKUP_FILE=\nCOMPRESS=\nDAYS_TO_KEEP=7\n\n```\n\nEnsure that the configuration file is readable. If the file is unreadable or missing required parameters, the script will terminate with an error message.\n\n\n## License\n\nMIT © [webmasterish](https://webmasterish.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterish%2Fmysql_backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmasterish%2Fmysql_backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterish%2Fmysql_backup/lists"}