1

I have an apache webserver that has the code mounted through SSHFS. When I make a change to a file on the remote computer, the webserver does not show the change. If I interact with the file in any way, such as cat or vim and do not make any changes, then the webserver will show the change correctly and the file modification time updates.

Is there a way to get the file modification time to update correctly, or perhaps I need to modify apache in some way so that it definitely reads the files (perhaps there is some sort of cache based on times that it uses which I could disable)?

4
  • Where are you cating from? What happens if you write wait a minute, then try to access the page? – ctrl-alt-delor Apr 9 '15 at 13:05
  • 1
    The manual for sshfs mentions some caches, you can change the time-outs on them. – ctrl-alt-delor Apr 9 '15 at 13:07
  • Have a look at this tutorial digitalocean.com/community/tutorials/… whether this helps. – vembutech Apr 9 '15 at 13:09
  • @richard You were right about the cache. If you add -o cache=no to the sshfs command then the changes are immediate. If you put that in an answer, I will mark it correct. – Programster Apr 9 '15 at 14:36
2

The manual for sshfs mentions some caches, you can change the time-outs on them.

Try -o cache=no. If that works, then consider setting the time-out to some low number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.