Just download the mysqlhotcopy script, change the hash bang to reflect your PHP interpreter’s location and chmod +x it to make it executable. Also change the backup_dir variable as per your requirements. Run it as a root in a cron job to automate backups.

Restoring the mysqlhotcopy backups

Restoring the backups is as easy as using a copy command. But first shutdown the mysql service: