|
From: <di...@us...> - 2008-11-19 16:37:29
|
Revision: 620
http://safekeep.svn.sourceforge.net/safekeep/?rev=620&view=rev
Author: dimi
Date: 2008-11-19 16:37:25 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
Run ssh/rdiff through nice so we can control the load better on the server.
Modified Paths:
--------------
safekeep/trunk/TODO
safekeep/trunk/doc/safekeep.conf.txt
safekeep/trunk/safekeep
safekeep/trunk/safekeep.spec.in
Modified: safekeep/trunk/TODO
===================================================================
--- safekeep/trunk/TODO 2008-11-19 15:05:21 UTC (rev 619)
+++ safekeep/trunk/TODO 2008-11-19 16:37:25 UTC (rev 620)
@@ -5,7 +5,6 @@
* Avoid snapshotting snapshots
* Don't snapshot a device if a snapshot is already present
* Protect against multiple safekeep instance running at once
- * Run ssh/rdiff through nice so we can control the load better
* Use -l with ssh to limit the bandwidth used during the backup
Feedback from users:
Modified: safekeep/trunk/doc/safekeep.conf.txt
===================================================================
--- safekeep/trunk/doc/safekeep.conf.txt 2008-11-19 15:05:21 UTC (rev 619)
+++ safekeep/trunk/doc/safekeep.conf.txt 2008-11-19 16:37:25 UTC (rev 620)
@@ -45,6 +45,14 @@
If not specified, `safekeep` will just use
`/usr/sbin/sendmail` to deliver the mail.
+nice.adjustment::
+ The nice level adjustment for safekeep, for the time
+ being used only on the server side.
+ It specifies an integer to be added to the current nice
+ level. Nicenesses range from -20 (most favorable scheduling)
+ to 19 (least favorable).
+ If no nice level is specified, safekeep is not niced.
+
FILES
-----
/etc/safekeep/safekeep.conf
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2008-11-19 15:05:21 UTC (rev 619)
+++ safekeep/trunk/safekeep 2008-11-19 16:37:25 UTC (rev 620)
@@ -706,9 +706,14 @@
else:
log(line[:-1])
-def do_server_rdiff(cfg, bdir, force):
- args = ['rdiff-backup']
+def do_server_rdiff(cfg, bdir, nice, force):
+ args = []
+ if (nice)
+ args.extend(['nice', '-n' + nice])
+
+ args.extend(['rdiff-backup'])
+
if cfg['host']:
schema = 'ssh %s -i %s %%s rdiff-backup --server' % (verbosity_ssh, cfg['key_data'])
args.extend(['--remote-schema', schema])
@@ -772,7 +777,7 @@
elif server_minor > client_minor:
warn('Protocol mismatch: %s <> %s' % (PROTOCOL, client_protocol))
-def do_server(cfgs, ids, force, cleanup):
+def do_server(cfgs, ids, nice, force, cleanup):
debug("Do server main loop")
for cfg in cfgs.itervalues():
id = cfg['id']
@@ -842,7 +847,7 @@
else:
backup_marker = None
- do_server_rdiff(cfg, bdir, force)
+ do_server_rdiff(cfg, bdir, nice, force)
errs = 0
if os.path.isdir(rdiff_logdir):
@@ -1122,6 +1127,7 @@
keys_status = None
keys_print = None
keys_deploy = None
+ nice_srv = None
for o, a in opts:
if o in ('-c', '--conf'):
if os.path.isdir(a) or a.endswith(config_ext):
@@ -1229,6 +1235,10 @@
smtp = props['email.smtp.server']
if 'email.to' in props:
email = props['email.to'].split(',')
+ if 'nice.adjustment' in props:
+ nice_srv = props['nice.adjustment']
+ if (nice_srv) nice_srv = int(nice_srv)
+
if len(cfglocs) == 0:
locs = os.path.join(os.path.dirname(cfgfile), 'backup.d')
if os.path.isdir(locs): cfglocs.append(locs)
@@ -1271,7 +1281,7 @@
if mode is 'server':
is_client = False
verbosity_level = 1 + verbosity
- do_server(cfgs, args, force, cleanup)
+ do_server(cfgs, args, nice_srv, force, cleanup)
elif mode is 'list':
if list_type is None:
list_type = 'increments'
Modified: safekeep/trunk/safekeep.spec.in
===================================================================
--- safekeep/trunk/safekeep.spec.in 2008-11-19 15:05:21 UTC (rev 619)
+++ safekeep/trunk/safekeep.spec.in 2008-11-19 16:37:25 UTC (rev 620)
@@ -116,6 +116,7 @@
%doc sample.backup
%changelog
+ - Run ssh/rdiff through nice so we can control the load better on the server
- Do not compress the SSH traffic, it is handled by rdiff-backup
- Add SSH verbosity control
- Fix dopey MySQL dump.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|