28 |
|
|
29 |
|
|
30 |
action = None |
action = None |
31 |
|
create_full_path = None |
32 |
remote_cmd, remote_schema = None, None |
remote_cmd, remote_schema = None, None |
33 |
force = None |
force = None |
34 |
select_opts = [] |
select_opts = [] |
41 |
|
|
42 |
def parse_cmdlineoptions(arglist): |
def parse_cmdlineoptions(arglist): |
43 |
"""Parse argument list and set global preferences""" |
"""Parse argument list and set global preferences""" |
44 |
global args, action, force, restore_timestr, remote_cmd, remote_schema |
global args, action, create_full_path, force, restore_timestr, remote_cmd |
45 |
global remove_older_than_string |
global remote_schema, remove_older_than_string |
46 |
global user_mapping_filename, group_mapping_filename |
global user_mapping_filename, group_mapping_filename |
47 |
def sel_fl(filename): |
def sel_fl(filename): |
48 |
"""Helper function for including/excluding filelists below""" |
"""Helper function for including/excluding filelists below""" |
55 |
|
|
56 |
try: optlist, args = getopt.getopt(arglist, "blr:sv:V", |
try: optlist, args = getopt.getopt(arglist, "blr:sv:V", |
57 |
["backup-mode", "calculate-average", "check-destination-dir", |
["backup-mode", "calculate-average", "check-destination-dir", |
58 |
"compare", "compare-at-time=", "current-time=", "exclude=", |
"compare", "compare-at-time=", "create-full-path", |
59 |
"exclude-device-files", "exclude-fifos", |
"current-time=", "exclude=", "exclude-device-files", |
60 |
"exclude-filelist=", "exclude-symbolic-links", |
"exclude-fifos", "exclude-filelist=", |
61 |
"exclude-sockets", "exclude-filelist-stdin", |
"exclude-symbolic-links", "exclude-sockets", |
62 |
"exclude-globbing-filelist=", |
"exclude-filelist-stdin", "exclude-globbing-filelist=", |
63 |
"exclude-globbing-filelist-stdin", "exclude-mirror=", |
"exclude-globbing-filelist-stdin", "exclude-mirror=", |
64 |
"exclude-other-filesystems", "exclude-regexp=", |
"exclude-other-filesystems", "exclude-regexp=", |
65 |
"exclude-special-files", "force", "group-mapping-file=", |
"exclude-special-files", "force", "group-mapping-file=", |
89 |
action = "compare" |
action = "compare" |
90 |
if opt == "--compare": restore_timestr = "now" |
if opt == "--compare": restore_timestr = "now" |
91 |
else: restore_timestr = arg |
else: restore_timestr = arg |
92 |
|
elif opt == "--create-full-path": create_full_path = 1 |
93 |
elif opt == "--current-time": |
elif opt == "--current-time": |
94 |
Globals.set_integer('current_time', arg) |
Globals.set_integer('current_time', arg) |
95 |
elif (opt == "--exclude" or |
elif (opt == "--exclude" or |
327 |
Log("Deleting %s" % rpout.path, 3) |
Log("Deleting %s" % rpout.path, 3) |
328 |
rpout.delete() |
rpout.delete() |
329 |
if not rpout.lstat(): |
if not rpout.lstat(): |
330 |
try: rpout.mkdir() |
try: |
331 |
|
if create_full_path: rpout.makedirs() |
332 |
|
else: rpout.mkdir() |
333 |
except os.error: |
except os.error: |
334 |
Log.FatalError("Unable to create directory %s" % rpout.path) |
Log.FatalError("Unable to create directory %s" % rpout.path) |
335 |
|
|