I'm working on a backup system over NFS, and I want to ensure as much as I can that the files are really written to the disk. Currently, when doing backups on my local hard disk, I copy everything into a temporary folder, do a sync() to flush the caches, rename the temporary folder to the final name, and do another sync(). That way, if system hangs during backup, or there's a power failure, the half-made backup will be in an easily-identified folder and can be deleted and started again when the system boots again.
Is it possible to do this over NFS? Do a "remote sync()" call to ensure that the server has flushed the cache to disk?
Thanks.