Would this tar command overwrite existing data?

0

So, I think the answer to this is no, however, I am still paranoid about my data - and just want confirmation from someone who is smarter than I.

In my quest to copy a directory to another directory and view the progress of the copy, I found this "one liner" on the googles.

sudo tar c $sourceDirectory | pv | sudo tar x -C $destinationDirectory

It appears to work great - but I negligently copied enough data to fill up the volume last night - and when I woke up, the copy operation still appeared to be in progress. My thoughts are that what I was seeing, re: still in progress, was just pv "doing stuff".. but in the back of my mind, I am anxiously wondering if any data could have been being overwritten to continue the file transfer. I have looked at the man page for tar and I see the parameters I used don't overwrite existing data, so I suppose that's a plus.

Again, I know, super paranoid..please forgive me! Anyone able to educate me a bit on this?

Thank you in advance!

trowel

Posted 2019-12-07T22:25:06.903

Reputation: 1

For large copies I would use rsync. It can also show progress, and in case I need to repeat the copy (because files have changed on the source, or because it was interrupted), I can repeat the same command and it will only copy changed/stil-not-copied files. – xenoid – 2019-12-08T10:49:23.933

No answers