From: Julien Moutinho Date: Fri, 19 Apr 2013 03:31:56 +0000 (+0200) Subject: Ajout : vm_remote : rule_mysql_backup . X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=commitdiff_plain;h=9f155a202d7b40a06d02ba92e5135dbd882f81c9 Ajout : vm_remote : rule_mysql_backup . --- diff --git a/vm_remote b/vm_remote index 64f57df..f735ba9 100755 --- a/vm_remote +++ b/vm_remote @@ -135,6 +135,19 @@ rule__runit_sv_configure () { # SYNTAX: $sv $configure_options . "$tool"/etc/sv/"$sv"/remote.sh || return 1 ) } +rule_mysql_backup () { + mkdir -p "$tool"/var/backup/mysql + rule ssh -l root ' + for db in $(sudo -u mysql mysql -u mysql --skip-column-names <<-EOF + SELECT schema_name + FROM information_schema.schemata + WHERE schema_name NOT IN ("information_schema", "performance_schema"); + EOF + ); do + $db + done + ' + } rule=${1:-help} ${1+shift}