I have to copy a relatively big file (6GB) to another server. To enforce consistency, I have to 'lock' this file and not use it during the transfer. I obviously want to minimize this downtime, but before this, I also want to estimate the time it will take to do so.
I can see 2 solutions :
copy the file locally and then transfer over the network (local). I'm thinking this will lead to the smallest downtime, but then, maybe I'm wrong as the disk will have to write and read the same file at the same time. Even with this, I have no idea how to estimate the time it will take to copy the file locally. Maybe creating a 6GB file and copying it would be meaningful, but then, how can I do this?
copy the file over the network directly (scp). This seams slow as network access is orders of magnitude slower than disk writing, but again, maybe I'm wrong.
Generally, how can I benchmark both approaches and decide which one is best for me?