15

If I rsync a directory with some remote directory under an sshfs management, even if the rsync process finishes synching the directory contents, there seems to be a time lag for the sshfs directory to get updated. It is unintuitive and makes some automation process relying on sshfs contents unstable.

How do I eliminate the lag?

OTZ
  • 2,763
  • 4
  • 25
  • 40

1 Answers1

22

-o cache=no in your sshfs options will turn off caching.


Note: no should be lower case: -o cache=NO should give you an error!

nbro
  • 12,226
  • 19
  • 85
  • 163
nmichaels
  • 45,418
  • 12
  • 95
  • 127
  • 3
    Odd. The man page for my copy of sshfs (2.2/FUSE 2.8.1/fusermount 2.8.1/FUSE kernel interface 7.12) says `-o cache=YESNO`. Anyway, fixed. – nmichaels Sep 08 '10 at 20:24
  • 5
    The man page of sshfs is misleading in that it capitalizes all the option values when cap'ed values are invalid. Mine's: `-o cache=YESNO enable caching {yes,no} (default: yes)` – OTZ Sep 08 '10 at 20:48
  • 3
    Wow, nutty. Not as nutty as the docs I'm reading now, but still nutty. – nmichaels Sep 08 '10 at 20:49
  • Works for me `-ocache=no` as per the [SSHFS wiki](https://github.com/osxfuse/osxfuse/wiki/SSHFS) – Ntwobike Sep 24 '15 at 08:49