Ajout : vm_remote : rule_mysql_backup .
authorJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Fri, 19 Apr 2013 03:31:56 +0000 (05:31 +0200)
committerJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Sat, 20 Apr 2013 15:49:30 +0000 (17:49 +0200)
vm_remote

index 64f57df..f735ba9 100755 (executable)
--- 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}