From: Clinton Ebadi Date: Sat, 26 Feb 2011 04:21:28 +0000 (-0500) Subject: Update database backup script to connect to fritz X-Git-Url: http://git.hcoop.net/clinton/scripts.git/commitdiff_plain Update database backup script to connect to fritz * Mysql has to use a special my.cnf stored in /root --- diff --git a/hcoop-all-db-backup b/hcoop-all-db-backup index 33e79ab..1a1697f 100755 --- a/hcoop-all-db-backup +++ b/hcoop-all-db-backup @@ -13,9 +13,9 @@ if ! test -d "$BACKUP_ROOT"; then exit 1 fi -MYSQL_DBS=`sudo -H mysqlshow | tail -n +4 | head -n -1 | cut -d' ' -f 2 | xargs` +MYSQL_DBS=`sudo -H mysqlshow --defaults-file=/root/.my.fritz.cnf | tail -n +4 | head -n -1 | cut -d' ' -f 2 | xargs` echo "Mysql Databases are: $MYSQL_DBS" -PGSQL_DBS=`sudo -u postgres psql template1 -c '\l' | tail -n +4 | head -n -2 | cut -d' ' -f 2 | xargs` +PGSQL_DBS=`sudo -u postgres psql -h postgres template1 -c '\l' | tail -n +4 | head -n -2 | cut -d' ' -f 2 | xargs` echo "Postgres Databases are: $PGSQL_DBS" # Delete oldest