Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.