]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/backup.py
Use CLI installer for MediaWiki 1.17.0 and later.
[wizard.git] / wizard / command / backup.py
index 3d5c991c0e9b361a00a53b66829a6b6d95427029..38f7dde64ebcb4933658ae131c7f6f7332d23349 100644 (file)
@@ -1,18 +1,13 @@
-import logging
-import optparse
-import sys
-import distutils.version
+import os.path
 
-from wizard import command, deploy, git, shell, util
+from wizard import command, deploy, shell, util
 
 def main(argv, baton):
     options, args = parse_args(argv, baton)
-    if not args:
-        dir = "."
-    else:
-        dir = args[0]
+    dir = os.path.abspath(args[0]) if args else os.getcwd()
     shell.drop_priviledges(dir, options.log_file)
     util.chdir(dir)
+    command.chdir_to_production()
     d = deploy.ProductionCopy(".")
     d.verify()
     d.verifyConfigured()
@@ -23,7 +18,7 @@ def parse_args(argv, baton):
 
 Takes a configured autoinstall and performs a backup of
 its data.  This data is stored by default in
-.scripts/backups/x.y.z-yyyy-mm-dd"""
+.wizard/backups/x.y.z-yyyy-mm-dd"""
     parser = command.WizardOptionParser(usage)
     options, args = parser.parse_all(argv)
     if len(args) > 1: