X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=remote%2Fmysql-backup;fp=remote%2Fmysql-backup;h=0879dfd9bb49c859b3ca188bddbc7604de5913d9;hp=0000000000000000000000000000000000000000;hb=3ad6118386977e346d81042e924e5db9c5f15b7d;hpb=22f04b9fac14adc3d3fc98273ba126c3a51792c3 diff --git a/remote/mysql-backup b/remote/mysql-backup new file mode 100755 index 0000000..0879dfd --- /dev/null +++ b/remote/mysql-backup @@ -0,0 +1,15 @@ +#!/bin/sh -eu +tool=$(readlink -e "${0%/*}/..") +. "$tool"/remote/lib.sh + +mkdir -p "$tool"/var/backup/mysql +"$tool"/remote/ssh -l backup ' + for db in $(sudo -u backup mysql -u backup --skip-column-names <<-EOF + SELECT schema_name + FROM information_schema.schemata + WHERE schema_name NOT IN ("information_schema", "performance_schema"); + EOF + ); do + echo $db + done + '