Index: /branches/ipp-259_genericise_backups/tools/backups/README
===================================================================
--- /branches/ipp-259_genericise_backups/tools/backups/README	(revision 40963)
+++ /branches/ipp-259_genericise_backups/tools/backups/README	(revision 40963)
@@ -0,0 +1,13 @@
+README
+
+This module contains files that perform backups of various services used by
+the IPP. Each file has it's own backup class, which is inherited from the base
+class. To perform a backup there needs to a config that matches the expected
+schema.
+
+Run 'deploy_backups.py' to deploy the relevant scripts and utils to the machines 
+that the services live on.
+
+Check a config is in place for each backup.
+
+If automated backup is desired run the script periodically in a crontab.
Index: /branches/ipp-259_genericise_backups/tools/backups/deploy_backups.py
===================================================================
--- /branches/ipp-259_genericise_backups/tools/backups/deploy_backups.py	(revision 40963)
+++ /branches/ipp-259_genericise_backups/tools/backups/deploy_backups.py	(revision 40963)
@@ -0,0 +1,63 @@
+import argparse
+import sys
+
+import utils.subprocess_utils as sub_utils
+
+DEFAULT_DEPLOYMENT = \
+    { "jira_backup.py"           : "ippops4"
+    , "confluence_backup.py"     : "ippops4"
+    , "svn_backup.py"            : "ippops4"
+    , "mailman_backup.py"        : "ippops3"
+    , "ippops_homedir_backup.py" : "ippops3"
+    , "website_backup.py"        : "ippops3"
+    }
+
+ADDITIONAL_FILES = \
+    [ './utils'
+    , 'backup.py'
+    ]
+
+PREFIX = "/export/"
+SUFFIX = ".0/backups/"
+
+
+def deploy(user=None):
+
+    for file in DEFAULT_DEPLOYMENT:
+        default_machine = DEFAULT_DEPLOYMENT[file]
+
+        chosen_machine = input(f"Enter machine to copy {file} to [default={default_machine}; ENTER to accept]:")
+        chosen_machine.strip('\n').strip(' ')
+        if chosen_machine == '':
+            chosen_machine = default_machine
+
+        copy_file_and_utils(file, chosen_machine, user)
+
+
+def copy_file_and_utils(file, machine, user):
+    # copy all the utils across too
+    user_at = '' if user is None else f'{user}@'
+    target = f"{user_at}{machine}.ifa.hawaii.edu:{PREFIX}{machine}{SUFFIX}"
+    args = ['rsync', '-a', '--progress', file, ] + ADDITIONAL_FILES + [target]
+    print(f"Performing: {' '.join(args)}")
+    sub_utils.simple_unix_wrapper(args)
+
+
+def main():
+    args = parse_args(sys.argv[1:])
+    args_dict = vars(args)
+    deploy(**args_dict)
+
+
+def parse_args(args):
+    parser = argparse.ArgumentParser(
+        description='Performs deploys backup files to desired locations')
+    parser.add_argument('--user'
+        , nargs='?'
+        , help='specify the user to transfer files as'
+        )
+    return parser.parse_args()
+
+
+if __name__ == "__main__":
+    main()
