thesfinox / sql-simple-backup

Simple script to backup data in a MySQL database and store it in a WebDAV server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
[client]
user = username
password = the_password
  • ~/.dbdumpbackup/config (create with mkdir ~/.dbdumpbackup):
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.

About

Simple script to backup data in a MySQL database and store it in a WebDAV server.

License:MIT License


Languages

Language:Shell 100.0%