0

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?

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151

1 Answers1

1

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

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
McJeff
  • 2,039
  • 13
  • 11