|
From: <di...@us...> - 2007-01-25 04:09:20
|
Revision: 288
http://safekeep.svn.sourceforge.net/safekeep/?rev=288&view=rev
Author: dimi
Date: 2007-01-24 20:09:17 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
If the backup.log exists, mark current possition and dump starting from the marker only
Modified Paths:
--------------
safekeep/trunk/safekeep
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2007-01-24 19:58:01 UTC (rev 287)
+++ safekeep/trunk/safekeep 2007-01-25 04:09:17 UTC (rev 288)
@@ -1,7 +1,7 @@
#!/usr/bin/python
import getopt, os, os.path, popen2, re, sys
-import commands, tempfile, traceback
+import commands, tempfile, time, traceback
import xml.dom.minidom
import socket, smtplib
@@ -46,11 +46,16 @@
else:
print >> sys.stderr, msg
-def info_file(file):
+def info_file(file, marker=None):
info('## File: ' + file)
fin = open(file, 'r')
try:
for line in fin.readlines():
+ if marker:
+ if line.startswith(marker):
+ marker = None
+ else:
+ continue
info(line.rstrip())
finally:
fin.close()
@@ -554,10 +559,16 @@
else:
rdiff_logpre = []
+ backup_log = os.path.join(rdiff_logdir, 'backup.log')
+ if os.path.isfile(backup_log):
+ backup_marker = '=== Backup session on %s ===' % time.asctime()
+ else:
+ backup_marker = None
+
do_server_rdiff(cfg, bdir)
if os.path.isdir(rdiff_logdir):
- info_file(os.path.join(rdiff_logdir, 'backup.log'))
+ info_file(backup_log, backup_marker)
rdiff_logpost = os.listdir(rdiff_logdir)
for lfn in rdiff_logpost:
if lfn.startswith('session_statistics.') and lfn.endswith('.data') and lfn not in rdiff_logpre:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|