up vote 0 down vote favorite
1
share [g+] share [fb]

Server A generates a file and scp's it to Server B. I have cron running on Server B that each minute looks for new files that were copied over. My question is- how can Server B ensure that the file that was copied over is actually done being copied? I don't want to start processing the file unless it's been fully written to. Is this possible to determine?

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

SCP it over under a temporary name and then rename it to its proper name, as the move will be an atomic process.

link|improve this answer
works for me! great idea! – rizen Mar 19 '10 at 21:43
feedback

Your Answer

 
or
required, but never shown