Commit 05bd3c85 authored by bescoto's avatar bescoto

Fixed --print-statistics and spurious server error message


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@290 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent e15ac611
New in v0.11.3 (2003/04/01) New in v0.11.3 (2003/04/01)
--------------------------- ---------------------------
Brought some old parts of the man page up-to-date (thanks to Olivier Fixed a number of bugs reported by Olivier Mueller:
Mueller).
Brought some old parts of the man page up-to-date.
Fixed bug if unrecoverable error on second backup to a directory.
Fixed spurious error message that could appear after a successful
backup.
--print-statistics option works again (before it would silently
ignored).
Fixed bug if unrecoverable error on second backup to a directory (also
repored Olivier Mueller).
New in v0.11.2 (2003/03/01) New in v0.11.2 (2003/03/01)
......
...@@ -204,6 +204,7 @@ def take_action(rps): ...@@ -204,6 +204,7 @@ def take_action(rps):
"""Do whatever action says""" """Do whatever action says"""
if action == "server": if action == "server":
connection.PipeConnection(sys.stdin, sys.stdout).Server() connection.PipeConnection(sys.stdin, sys.stdout).Server()
sys.exit(0)
elif action == "backup": Backup(rps[0], rps[1]) elif action == "backup": Backup(rps[0], rps[1])
elif action == "restore": Restore(*rps) elif action == "restore": Restore(*rps)
elif action == "restore-as-of": RestoreAsOf(rps[0], rps[1]) elif action == "restore-as-of": RestoreAsOf(rps[0], rps[1])
......
...@@ -154,7 +154,7 @@ class DestinationStruct: ...@@ -154,7 +154,7 @@ class DestinationStruct:
Hardlink.islinked(src_rorp or dest_rorp)): Hardlink.islinked(src_rorp or dest_rorp)):
dest_sig = rpath.RORPath(index) dest_sig = rpath.RORPath(index)
dest_sig.flaglinked(Hardlink.get_link_index(dest_sig)) dest_sig.flaglinked(Hardlink.get_link_index(dest_sig))
elif dest_rorp: elif dest_rorp:
dest_sig = dest_rorp.getRORPath() dest_sig = dest_rorp.getRORPath()
if dest_rorp.isreg(): if dest_rorp.isreg():
dest_rp = dest_base_rpath.new_index(index) dest_rp = dest_base_rpath.new_index(index)
...@@ -311,6 +311,7 @@ class CacheCollatedPostProcess: ...@@ -311,6 +311,7 @@ class CacheCollatedPostProcess:
"""Process the remaining elements in the cache""" """Process the remaining elements in the cache"""
while self.cache_indicies: self.shorten_cache() while self.cache_indicies: self.shorten_cache()
metadata.CloseMetadata() metadata.CloseMetadata()
if Globals.print_statistics: statistics.print_active_stats()
statistics.write_active_statfileobj() statistics.write_active_statfileobj()
......
...@@ -393,5 +393,5 @@ class CacheIndexable: ...@@ -393,5 +393,5 @@ class CacheIndexable:
try: return self.cache_dict[index] try: return self.cache_dict[index]
except KeyError: except KeyError:
assert index >= self.cache_indicies[0], \ assert index >= self.cache_indicies[0], \
repr((index, self.cache_indicies[0])) "Index out of order: "+repr((index, self.cache_indicies[0]))
return None return None
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"""Generate and process aggregated backup information""" """Generate and process aggregated backup information"""
import re, os, time import re, os, time
import Globals, robust, Time, rorpiter, increment import Globals, robust, Time, rorpiter, increment, log
class StatsException(Exception): pass class StatsException(Exception): pass
...@@ -342,3 +342,11 @@ def write_active_statfileobj(): ...@@ -342,3 +342,11 @@ def write_active_statfileobj():
_active_statfileobj.finish() _active_statfileobj.finish()
_active_statfileobj.write_stats_to_rp(session_stats_rp) _active_statfileobj.write_stats_to_rp(session_stats_rp)
_active_statfileobj = None _active_statfileobj = None
def print_active_stats():
"""Print statistics of active statobj to stdout and log"""
global _active_statfileobj
assert _active_statfileobj
statmsg = _active_statfileobj.get_stats_logstring("Session statistics")
log.Log.log_to_file(statmsg)
Globals.client_conn.sys.stdout.write(statmsg)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment