Sfoglia il codice sorgente

Merge pull request #190 from aznashwan/sync-disk-buffers

Force FS buffer sync through SSH/file writers.
Nashwan Azhari 5 anni fa
parent
commit
095b256988
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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: