1. Goal
Save SQL dumps in a simple way with predictable naming and final validation of the generated file.
2. Files and components involved
/root/bin/backup-mariadb.sh
/usr/bin/mysqldump
/backup/sql
3. Operational flow
mkdir -p /backup/sql
create script mysqldump compresso
chmod 700 /root/bin/backup-mariadb.sh
schedule in cron
4. Operational verification
run script
ls -lh /backup/sql
gzip -t dump.sql.gz
test restore in a safe environment
5. Practical notes
An unverified backup is not a backup yet: test restore, retention, and naming before putting it into production.
Rotation and retention only make sense if you really know how much space they use and how long restoration takes.
Quick checklist
[ ] Backup or copy of the existing configuration completed
[ ] Files and commands updated as expected
[ ] Local test completed successfully
[ ] Logs or final output verified
[ ] Rollback procedure documented