18

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
  • 3,003
  • 4
  • 29
  • 41

1 Answers1

26

-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
  • 15,395
  • 32
  • 113
  • 196
nmichaels
  • 49,466
  • 12
  • 107
  • 135
  • 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