Commits

Colin Copeland  committed 565f1d1

require .my.cnf for MySQL; fix duplication bug in configuratin parsing

  • Participants
  • Parent commits 13d937c

Comments (0)

Files changed (2)

         if self.databases:
             databases = self.databases
         databases -= DATABASES_TO_IGNORE
-        self.logger.info('databases: %s', databases)
+        self.logger.debug('databases: %s', databases)
         for database in databases:
             self.logger.info('backing up %s' % database)
             self.backup_postgres_database(database)
         self.backup_all_databases()
 
     def backup_all_databases(self):
+        self.logger.info('backing up all MySQL databases')
         filename = 'mysqldumpall.sql.%s' % self.compression
         path = os.path.join(self.dest, filename)
-        cmd = "mysqldump -uroot --all-databases | %s" % self.compression
+        cmd = "mysqldump --all-databases | %s" % self.compression
         fh = open(path, 'w+')
         self.remote(cmd, stdout=fh)
         fh.close()

File scripts/dbbu-run.py

             data['sudo_user'] = cfg.get(host, 'sudo_user')
         data.update(shared)
         if cfg.has_option(host, 'postgres'):
+            pg_data = {}
             databases = cfg.get(host, 'postgres').strip()
             if databases not in ('ALL', ''):
-                data['databases'] = databases.split(',')
-            engines.append(dbbu.PostgreSQL(**data))
+                pg_data['databases'] = databases.split(',')
+            if cfg.has_option(host, 'postgres_sudo_user'):
+                pg_data['sudo_user'] = cfg.get(host, 'postgres_sudo_user')
+            pg_data.update(data)
+            engines.append(dbbu.PostgreSQL(**pg_data))
         if cfg.has_option(host, 'mysql'):
             engines.append(dbbu.MySQL(**data))
     for engine in engines: