Install dbxcli and place it inside bin
folder in your home directory.
# mark binary as executable
$ chmod a+x ~/bin/dbxcli
# login to your account
$ ~/bin/dbxcli account
Create a backup
folder in your home directory.
$ mkdir ~/backup
Save your MySQL/MariaDB credentials in a file named .my.cnf
in your home directory:
$ nano ~/.my.cnf
Put contents similar to below, make sure to replace values:
[mysqldump]
user=root
password=root_password
Download and place the mybak.sh
file into bin
folder in your home directory then issue below command.
$ chmod a+x ~/bin/mybak.sh
Now set up a cron job to schedule backup for database of your choice.
$ crontab -e
Insert below line to the end of cron configuration:
0 10 * * * env DB_NAME=test PATH="$PATH:$HOME/bin" ~/bin/mybak.sh >> /dev/null 2>&1