Preperation
- Install mariadb-backup and rsync on your database server.
- Download both shell scripts from the github gist and place them for example your users home folder on the database server.
- Create a folder which is used, to temporary store the backup data and enter the full path in both scripts to the enviroment variable BACKUP_DIR (default is /var/mariadb/backup).
- Create a folder (or mount point) where the backup files should get moved. At its best, this folder points to a remote location to store your backups not on the same machine/vm. Enter the full path in both scripts to the enviroment variable BACKUP_FILE_DEST (default is /mnt/backup-database).
- Change the enviroment variable TARGET_NAME_PREFIX in both scripts if you use these scripts for more then one backup task (more on this later).
- Create a user on your database server and grant the following privileges [1] to all databases if you have MariaDB >v10.5: RELOAD, PROCESS, LOCK TABLES, BINLOG MONITOR. You should only allow the us