Update database backup script to connect to fritz
[clinton/scripts.git] / hcoop-all-db-backup
index 33e79ab..1a1697f 100755 (executable)
@@ -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