How to do backing up mysql databases with Rsnapshot
What is Rsnapshot?
From the official website: “rsnapshot is a filesystem snapshot utility based on rsync. rsnapshot makes it easy to make periodic snapshots of local machines, and remote machines over ssh. The code makes extensive use of hard links whenever possible, to greatly reduce the disk space required”.
Setup mysql client
Install mysql-client if not installed, this will provide the mysqldump utility
Make sure your backup scripts are owned by root, and not writable by anyone else.
This scripts is designed only to back up all databases to a single file.
Edit script
replace
with
If you need to dump a single database use line below
Setup Rsnapshot
Add script to rsnapshot
Edit rsnapshot config
Under BACKUP POINTS / SCRIPTS add following
Test config
Links
- https://rsnapshot.org/