Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

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.

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

Your Answer

 
discard

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