Quote:
Originally Posted by
acascianelli
I have a Linux server that runs a Java based app that automates file transfers for a large number of users/systems. I'm running into a problem with the scripts for this automation program in that when I have a function in the script generate an output file, and the next line requires that file to be present; the script will fail because the file hasn't made it to disk yet.
sync is irrelevant -- a file in cache is as good as a file on disk as far as programs are concerned. The file must really be
missing, even from cache, a sync won't force it to appear. It's the wait that does the trick either way.
Both
sync and short delays are liable to fail I think -- particularly when the system is busy and longer delays might happen. Either correct the java program so it doesn't return until the file actually exists, or poll for the file's existence every so often.
Quote:
My question is, could there be any undesired side affects to running the 'sync' command so often on a system?
Reduced disk performance since its busy doing more writes all the time. It may end up writing more than it would have otherwise, too.