Close logger before dir rename
authorStefan Huber <shuber@sthu.org>
Tue, 19 Dec 2017 18:55:10 +0000 (19:55 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 19 Dec 2017 18:55:10 +0000 (19:55 +0100)
Certain filesystems require that the log file is closed befor the
containing backup directory is renamed from its temporary name to the
final name.

sitarba

diff --git a/sitarba b/sitarba
index ecf6f5f..9a7519b 100755 (executable)
--- a/sitarba
+++ b/sitarba
@@ -532,6 +532,7 @@ class BackupManager:
             self.backupFileSet(s, targetdir, excludes, since)
 
         logfile.info("Stopped: " + datetime.datetime.now().ctime())
+        fil.close()
 
         # Rename backup directory to final name
         os.rename( targetdir, os.path.join(basedir, dirname) )