diff --git a/qvm-tools/qvm-backup-restore b/qvm-tools/qvm-backup-restore index d4c9b738..aeb394b8 100755 --- a/qvm-tools/qvm-backup-restore +++ b/qvm-tools/qvm-backup-restore @@ -33,7 +33,7 @@ import sys import getpass def main(): - usage = "usage: %prog [options] " + usage = "usage: %prog [options] [vmname ...]" parser = OptionParser (usage) parser.add_option ("--skip-broken", action="store_true", dest="skip_broken", default=False, @@ -71,11 +71,12 @@ def main(): (options, args) = parser.parse_args () - if (len (args) != 1): + if (len (args) < 1): print >> sys.stderr, "You must specify the backup directory (e.g. /mnt/backup/qubes-2010-12-01-235959)" exit (0) backup_dir = args[0] + vmlist = args[1:] #if not os.path.exists (backup_dir): # print >> sys.stderr, "The backup directory doesn't exist!" @@ -123,6 +124,13 @@ def main(): print >> sys.stderr, "ERROR: %s" % str(e) exit(1) + if len(vmlist) > 0: + for vm in restore_info.keys(): + if vm.startswith('$'): + continue + if not vm in vmlist: + restore_info.pop(vm) + backup_restore_print_summary(restore_info) there_are_conflicting_vms = False