2

If I decide I want to copy a folder that is sufficiently large using cp, then half way through the copy I decide to abort or pause the process, will this ever cause corruption? Would it be better to let the copy finish and then delete the files?

nobody
  • 68
  • The files that are being created will be corrupt, but the file-system structure will not break. Just delete the files that were being created. – ctrl-alt-delor Jun 22 '18 at 22:17

1 Answers1

3

If you pause the process and resume it later, nothing bad will happen. As long as nothing else writes to the input or output file in the middle, the output will be a faithful copy of the original.

If you kill the copy process, then you'll end up with a partial copy in the output file. There's no point in waiting: if you want to cancel the copy, cancel it as soon as you've decided and remove the partial output.

The input file will never be affected by the copy operation except that its last-read timestamp may be updated.