NFS cache-cleaning command?
Depending on what you mean by "false-caching errors", running sync
may get you what you need. This will flush all filesystem buffers.
If needed, you can also clear out the VM caches in the kernel using /proc/sys/vm/drop_caches
.
# To free pagecache
echo 1 > /proc/sys/vm/drop_caches
# To free dentries and inodes
echo 2 > /proc/sys/vm/drop_caches
# To free pagecache, dentries and inodes
echo 3 > /proc/sys/vm/drop_caches
Within a given process, calling opendir()
and closedir()
on the parent directory of a file invalidates the NFS cache. I used this while programming a job scheduler. Very, very helpful. Try it!
This is the line number of the relevant code (showing the use in context): https://github.com/earonesty/grun/blob/master/grun#L820
It was the only way I could fix the issue of job #1 completing and job #2, which needed some output files, firing off in a context where those files were visible,