G
garan
Guest
Been meaning to tidy up my database backups for a while. I noticed that the mysql backups that Plesk does only backups up the psa and associated databases (e.g. horde).
Rather than re-invent the wheel, I took a copy of the mysqldump.sh script that's in /usr/local/psa/bin and modified it. I removed the bottom line that does the backup and replaced it with the following:
I'm not pretending that it's neat and welcome any comments or alternative methods..
Cheers,
Garan.
Rather than re-invent the wheel, I took a copy of the mysqldump.sh script that's in /usr/local/psa/bin and modified it. I removed the bottom line that does the backup and replaced it with the following:
Code:
for dbname in ` mysqlshow -u admin --password=$admin_passwd | grep -v "+" | grep -v "Databases" | tr ["|"] [" "]`; do
${MYSQL_BIN_D}/mysqldump --quote-names --user=admin --password=$admin_passwd --database $dbname > /root/mysqlbackups/$dbname.sql && rotate $dbname.sql 8 7 6 5 4 3 2 1 0 ;
done
I'm not pretending that it's neat and welcome any comments or alternative methods..
Cheers,
Garan.