Ubuntu SSHFS doesn't sync

10

2

I am trying to set up a Ubuntu-machine for web development, and thought i'd start working with SSHFS instead of the annoying FTP-protocol. I installed SSHFS through apt-get. I've created a folder in my documents folder called MyProject. I'm the owner of that folder.

I mount the remote folder to my local folder using

sshfs root@myproject.com:ftp.myproject.com/myproject.com/public_html /home/anton/Documents/MyProject

Followed by my password. Then the remote folder is indeed mounted. However, the changes i make on my local computer is not reflected on the server. What am i missing here?

Ubuntu 12.10

Anton Gildebrand

Posted 2013-01-27T12:03:44.307

Reputation: 315

why nobody answers this?? – holms – 2014-06-22T00:20:46.140

Answers

6

Add -o cache=no to the command

sshfs root@myproject.com:ftp.myproject.com/myproject.com/public_html /home/anton/Documents/MyProject -o cache=no

The same has been answered here: https://stackoverflow.com/questions/3671350/any-way-to-eliminate-time-lag-with-sshfs

Vikas Goel

Posted 2013-01-27T12:03:44.307

Reputation: 253

0

I had the same problem as @op but in more complex version - I mount root folder of remote device, and most importantly need to operate with remote sysfs.

The answer from @Vikas helped me but not completely. I tried adding mount options: sshfs_sync,sync_readdir,sync_read but none of that resolved my problem: sometimes (rather often) reads from the same path were still cached and thus I couldn't get the changed state on remote side. I guess this is because fs in this case (when sysfs entries are provided by kernel drivers) is unable to provide meaningful change/modification time. And fuse/sshfs on local side rely on these.

The only one option resolved my problem - direct_io. So, I recommend this option instead in case of remote sysfs is used and where synchronization is top priority.

sshfs <remote> <local> -o direct_io

pmod

Posted 2013-01-27T12:03:44.307

Reputation: 131