https://github.com/thesfinox/sql-simple-backup
Simple script to backup data in a MySQL database and store it in a WebDAV server.
https://github.com/thesfinox/sql-simple-backup
backup bash data mysql script sql webdav
Last synced: 9 months ago
JSON representation
Simple script to backup data in a MySQL database and store it in a WebDAV server.
- Host: GitHub
- URL: https://github.com/thesfinox/sql-simple-backup
- Owner: thesfinox
- License: mit
- Created: 2020-06-09T21:04:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-09T21:04:12.000Z (over 5 years ago)
- Last Synced: 2025-02-17T00:17:36.667Z (12 months ago)
- Topics: backup, bash, data, mysql, script, sql, webdav
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MySQL Dump Backup
This is a short snippet of code to dump a logical backup of a MySQL database
and upload it to a WebDAV server.
## Installation
You can install the script simply issuing the command `sudo install dbbackup
/path/to/install/location` from the command line.
## Setup
Once you have installed it remember to configure the MySQL client and the
remote WebDAV server credentials. Specifically prepare two files such as:
- **~/.my.cnf**:
```shell
[client]
user = username
password = the_password
```
- **~/.dbdumpbackup/config** (create with `mkdir ~/.dbdumpbackup`):
```shell
USR="username"
PSW="the password"
DBNAME="database name"
REMOTE="WebDAV location"
```
Remember to issue `chmod 600 ~/.my.cnf ~/.dbdumpbackup/config` for security
reasons.
## Crontab
You can have the script run as a cron job issuing `crontab -e` as your user and
add something like `00 12 * * * /path/to/install/location/dbbackup` to run
`dbbackup` every day at noon.
## License
This is free software available freely under the **MIT License**.