https://github.com/barisesen/mysql-backup
https://github.com/barisesen/mysql-backup
backup bash cron mysql
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/barisesen/mysql-backup
- Owner: barisesen
- Created: 2017-12-19T21:28:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-19T21:42:55.000Z (over 8 years ago)
- Last Synced: 2025-02-01T22:29:47.186Z (over 1 year ago)
- Topics: backup, bash, cron, mysql
- Language: Shell
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mysql Backup Script
Takes backups on a daily basis and deletes old backups.
## Usage
```sh
git clone https://github.com/barisesen/mysql-backup.git
cd mysql-backup
sudo chmod +x backup.sh
```
- Open backup.sh with text editor and edit configs.
- backup_dir="YOUR_BACKUP_DIR"
- mysql_user="YOUR_MYSQL_USER"
- mysql_password="YOUR_MYSQL_PASSWORD"
- mysql_database="YOUR_MYSQL_DATABASE_NAME"
Open your cron tab.
```sh
crontab -e
```
Add to the bottom line
```bash
0 1 * * * /bin/sh /your-install-directory/mysql-backup/backup.sh
```