dooblem / bsync

Bidirectional Synchronization using Rsync
GNU General Public License v3.0
292 stars 61 forks source link

Interrupting synchronization causes permanent tmp files #10

Closed ceremcem closed 8 years ago

ceremcem commented 10 years ago

If we interrupt synchronization by using Ctrl+C, temporary files that are used by rsync are left in the filesystem. Once we restart sync process, this tmp file is propagated between folders.

Maybe bsync should use a temporary folder to copy the file, and then use mv. That will be atomic.

dooblem commented 10 years ago

I'm not able to reproduce the problem. Temporary files are deleted when I hit Ctrl+C. And according to rsync man this is expected behaviour: --partial option is not enabled by default.

What rsync version are you using on each side?

ceremcem commented 10 years ago

I have experienced this problem while synchronizing folders that exists in the same computer.

rsync --version
rsync  version 3.1.0  protocol version 31
dooblem commented 10 years ago

I was able to reproduce the problem. It's an rsync bug.

truncate -s100M bigfile
timeout 0.3s rsync -av bigfile bigfile2
ls -ltra

Seems it's already fixed in rsync release candidate: http://rsync.samba.org/ftp/rsync/src-previews/rsync-3.1.1pre1-NEWS

It will be fixed in rsync 3.1.1 Maybe I will think of a workaround.