Commits

Colin Copeland  committed 5596e8a

dump pg/mysql into seperate sub-directories

  • Participants
  • Parent commits 565f1d1

Comments (0)

Files changed (2)

 
     def __init__(self, host, dest, **kwargs):
         self.host = host
-        self.dest = os.path.join(dest, self.host)
+        self.dest = dest
         self.compression = kwargs.pop('compression', 'gzip')
         self.sudo_user = kwargs.pop('sudo_user', '')
         self.fmod = kwargs.pop('fmod', 0600)
     PostgreSQL backup class to dump globals and all databases individually
     """
 
+    def __init__(self, host, dest, **kwargs):
+        dest = os.path.join(dest, host, 'postgres')
+        super(PostgreSQL, self).__init__(host, dest, **kwargs)
+
     def run(self):
         self.backup_postgres_globals()
         databases = set(self.get_postgres_databases())
 class MySQL(Backup):
     """ MySQL backup recipe """
 
+    def __init__(self, host, dest, **kwargs):
+        dest = os.path.join(dest, host, 'mysql')
+        super(MySQL, self).__init__(host, dest, **kwargs)
+
     def run(self):
         self.backup_all_databases()
 

File scripts/dbbu-run.py

             if cfg.has_option(host, 'postgres_sudo_user'):
                 pg_data['sudo_user'] = cfg.get(host, 'postgres_sudo_user')
             pg_data.update(data)
+            print pg_data
             engines.append(dbbu.PostgreSQL(**pg_data))
         if cfg.has_option(host, 'mysql'):
             engines.append(dbbu.MySQL(**data))