Commits

Colin Copeland committed 70d7960

execute proper host; add docstrings

  • Participants
  • Parent commits 13d4a9b

Comments (0)

Files changed (1)

postgresql_backup.py

 #!/usr/bin/python
+"""
+A simple script to automate remote PostgreSQL backups
+"""
 
 import os
 import sys
 
 
 class Backup(object):
+    """ Base backup class to handle common remote commands """
 
     def __init__(self, host, sudo='', compression='gzip'):
         self.host = host
 
 
 class PostgreSQL(Backup):
+    """
+    PostgreSQL backup class to dump globals and all databases individually
+    """
 
     def run(self):
         self.backup_postgres_globals()
         parser.print_usage()
         return -1
     for host in hosts:
-        pg = PostgreSQL(host='postgres@192.168.56.3',
-                        compression=options.compression)
+        pg = PostgreSQL(host=host, compression=options.compression)
         pg.run()