import re
import random
import shutil
+import sys
from datetime import datetime
from functools import partial
parser.add_argument("-r", "--restore", action='store_true',
help="Restore a backup.")
parser.add_argument("-R", "--recover", action='store_true',
- help="Restore a backup with an index file.")
+ help="Recover a potentially damaged backup with an index "
+ "file. **Caution**: recovery mode is insecure; it ignores "
+ "data integrity checks on encrypted backup sets which may "
+ "allow unauthorized decryption of confidential information.")
parser.add_argument("-f", "--full", action='store_true',
help="Create a full backup.")
parser.add_argument("-d", "--diff", action='store_true',
else:
deltatar.restore_backup(args.targetpath, backup_tar_path=args.sourcepath)
elif args.recover:
+ if args.sourcepath is not None:
+ print("Disaster recovery conflicts with --sourcepath; please supply"
+ " an\nindex file (--indexes).", file=sys.stderr)
failed = deltatar.recover_backup(args.targetpath,
- backup_indexes_paths=args.indexes,
- backup_tar_path=args.sourcepath)
+ backup_indexes_paths=args.indexes)
if len (failed) > 0:
logger = logging.getLogger('deltatar.DeltaTar')
print ("%d files could not be restored:" % len (failed))
elif args.equals:
check_equal_dirs(os.path.abspath(args.sourcepath), os.path.abspath(args.targetpath), deltatar)
else:
- import sys
print("Nothing to do.\nPlease specify one of --full, --diff, --list-files, "
"--restore, --equals.\n", file=sys.stderr)
parser.print_help(file=sys.stderr)