|
From: <st...@us...> - 2007-10-09 11:44:02
|
Revision: 547
http://safekeep.svn.sourceforge.net/safekeep/?rev=547&view=rev
Author: stelian
Date: 2007-10-09 04:43:58 -0700 (Tue, 09 Oct 2007)
Log Message:
-----------
Implement --force to handle the unexpected.
Modified Paths:
--------------
safekeep/trunk/doc/safekeep.txt
safekeep/trunk/safekeep
Modified: safekeep/trunk/doc/safekeep.txt
===================================================================
--- safekeep/trunk/doc/safekeep.txt 2007-09-08 06:06:59 UTC (rev 546)
+++ safekeep/trunk/doc/safekeep.txt 2007-10-09 11:43:58 UTC (rev 547)
@@ -7,7 +7,7 @@
SYNOPSIS
--------
-'safekeep' [--server] [-q] [-v] [-c file] <clientid>*
+'safekeep' [--server] [-q] [-v] [--force] [-c file] <clientid>*
'safekeep' --keys [-q] [-v] [-c file] [-i file] [--status] [--print] [--deploy] <clientid>*
@@ -64,6 +64,12 @@
GENERAL OPTIONS
---------------
+-c, --conf=FILE::
+ Specifies the configuration file location.
+ If not specified at all, SafeKeep will default to
+ `/etc/safekeep/safekeep.conf` if it exists.
+ Simply using this default is the recommended usage.
+
-h, --help::
Selects the help mode, in which safekeep prints out the
online help and exits.
@@ -82,11 +88,12 @@
SERVER OPTIONS
--------------
--c, --conf=FILE::
- Specifies the configuration file location.
- If not specified at all, SafeKeep will default to
- `/etc/safekeep/safekeep.conf` if it exists.
- Simply using this default is the recommended usage.
+--force::
+ Pass the `--force` option to `rdiff-backup`, allowing it
+ to overwrite the backup directory metadata. This option
+ is potentially dangerous, and should only be used if the
+ backup directory becomes corrupt, and `rdiff-backup` error
+ logs tells you to use this option.
KEYS OPTIONS
------------
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2007-09-08 06:06:59 UTC (rev 546)
+++ safekeep/trunk/safekeep 2007-10-09 11:43:58 UTC (rev 547)
@@ -511,13 +511,16 @@
else:
log(line[:-1])
-def do_server_rdiff(cfg, bdir):
+def do_server_rdiff(cfg, bdir, force):
args = ['rdiff-backup']
if cfg['host']:
schema = 'ssh -C -i %s %%s rdiff-backup --server' % (cfg['key_data'])
args.extend(['--remote-schema', schema])
+ if force:
+ args.extend(['--force'])
+
#args.extend([ '-v', '6'])
for clude in cfg['cludes']:
opt = '--' + clude['type']
@@ -549,7 +552,7 @@
if server_major != client_major:
raise Exception('Incompatible protocols: %s <> %s' % (PROTOCOL, client_protocol))
-def do_server(cfgs, ids):
+def do_server(cfgs, ids, force):
debug("Do server main loop")
for cfg in cfgs.itervalues():
id = cfg['id']
@@ -610,7 +613,7 @@
else:
backup_marker = None
- do_server_rdiff(cfg, bdir)
+ do_server_rdiff(cfg, bdir, force)
if os.path.isdir(rdiff_logdir):
info_file(backup_log, backup_marker)
@@ -793,6 +796,9 @@
print '-v, --verbose increases the verbosity level'
print '-V, --version show the version number and exit'
print
+ print 'server options:'
+ print '--force force backup destination overwriting, dangerous!'
+ print
print 'keys options:'
print '-i FILE use FILE as identity for RSA/DSA authentication'
print '--status display the key status for the clients (default)'
@@ -804,9 +810,9 @@
try:
opts, args = getopt.getopt(sys.argv[1:], 'c:e:i:hs:qvV',
[ 'conf=', 'client', 'clientid=', 'deploy',
- 'email=', 'help', 'keys', 'print',
- 'quiet', 'server', 'smtp=', 'status',
- 'verbose', 'version'])
+ 'email=', 'force', 'help', 'keys',
+ 'print', 'quiet', 'server', 'smtp=',
+ 'status', 'verbose', 'version'])
except getopt.GetoptError:
usage(2)
@@ -818,6 +824,7 @@
cfglocs = []
verbosity = 0
clientid = None
+ force = 0
identity = None
keys_status = None
keys_print = None
@@ -851,6 +858,8 @@
elif o in ('--keys', ):
if mode: usage(2)
mode = 'keys'
+ elif o in ('--force', ):
+ force = 1
elif o in ('-i', ):
identity = a
elif o in ('--status', ):
@@ -937,7 +946,7 @@
if mode is 'server':
is_client = False
verbosity_level = 1 + verbosity
- do_server(cfgs, args)
+ do_server(cfgs, args, force)
elif mode is 'client':
is_client = True
verbosity_level = 3 + verbosity
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|