Duat is OpenSource project which is the script to remote or locally backup database like mysql, postgre, etc.
You need your user for connect to database. If you using remote database please check the firewall and ip rule on database config. We recommend not give userbackup privilage to write database or table.
Just run init.sh to setup your file.
bash init.sh
After that edit .env
. You must setup the path to save the database and time periode database will be save
TIME_PERIOD=30 // by default 30 days
PATH_BACKUP=PATH // required
For example we want to backup the mysql, change the variable for mysql
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_USERNAME=username
MYSQL_PASSWORD=password
MYSQL_DATABASE=db_name
🗒 Note : you do not have to setup all environment variable just select variable you want to backup
Run with bash
or sh
it will automatic run the command
bash mysql.sh
If you want to run automatic everyday use cronjob to run it, just setup in crotab
Example run cronjob at 00.01 AM every day
1 00 * * * bash /path/to/file/mysql.sh
- Bash - Command Language
- Mysql - Database
- Postgre - Database
- crontab guru - crontab
- @Herdanis - Idea & Initial work
See also the list of contributors who participated in this project.