瀏覽代碼

Force FS buffer sync through SSH/file writers.

Nashwan Azhari 5 年之前
父節點
當前提交
39013c34a7
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      coriolis/providers/backup_writers.py

+ 2 - 0
coriolis/providers/backup_writers.py

@@ -225,6 +225,7 @@ class FileBackupWriterImpl(BaseBackupWriterImpl):
 
     def close(self):
         self._file.close()
+        os.system("sudo sync")
         self._file = None
 
 
@@ -385,6 +386,7 @@ class SSHBackupWriterImpl(BaseBackupWriterImpl):
 
         if self._ssh:
             self._send_msg(self._encode_eod())
+            self._ssh.exec_command("sudo sync")
             self._ssh.close()
             self._ssh = None
         if self._sender_evt: