I am working with some source files from a desktop computer. The source files compile and run on a remote server.
As there is a significant delay between me and the server, I have decided to use rsync
to copy the files down to my computer, edit them, and then sync them back up, again using rsync
.
However there is a problem... rsync
doesn't update the files when I sync them back up to the server after editing them at my end. The incremental file list is sent, but the file contents are unmodified.
Here is a full output of my bash session which will explain in detail what happens.
- I have some files on my local machine. I edit one of those files, using an editor such as
vim
. The file structure is fairly generic. I have a project root directory called2016-07-01
, which contains many subfolders and source files. The folder is just named with the date as a method of version control.
(bash)
$ rsync -av ./2016-07-01 user@server:./path-to-project/2016-07-01
user@server's password: [enter password]
sending incremental file list
2016-07-01/subfolder/
2016-07-01/subfolder/main.cpp
sent 2,238 bytes received 272 bytes 557.78 bytes/sec
total size is 632,957 speedup is 252.17
It looks like main.cpp has been updated, but when I
ssh
into the server and open it withvim
I see that it is unchanged. Why is this happening?I then run the same command again and the following output is produced...
(bash)
$ rsync -av ./2016-07-01 user@server:./path-to-project/2016-07-01
user@server's password: [enter password]
sending incremental file list
sent 1,342 bytes received 36 bytes 110.24 bytes/sec
total size is 632,957 speedup is 459.33
This time no incremental file list is sent - I am not sure why - it is as if
rsync
thinks it has updated the files already and therefore does nothing when it has not...If I check
main.cpp
at my end it has definitely been changed.main.cpp
on the server side is unchanged.
I have also tried using the -c
flag for checksums rather than date-time-stamps, again the same result is seen.