[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: moving dir with lots of files



On 18/4/22 12:24, Bijan Soleymani wrote:
On 2022-04-18 00:16, Adriel Peng wrote:
Hello

I plan to move a dir which has about 0.4 million files to a new location. This new location is a network storage.

I will run the command:

nohup mv dir /mnt/disk/newdir

I guess this will take a lot of hours to finish.

My question is, if the process gets an unexpected interruption, what will happen and how can I recover it?

Thanks.


If you can afford not to do a move but a copy and then a delete, then I would recommend using rsync

rsync will transfer what is missing if interrupted

If there is nothing missing it will finish pretty quickly.

I sync 130GB in 1.4 million files over the internet regularly and if there are no changes it take about 20 seconds to finish (the disks are fast on both ends).

If there are changes it transfers about as fast as the network can go.

Bijan


I have found that

rsync -avHb --remove-source-files dir /mnt/disk/newdir

moves files in one process. If it is interupted, re-running will simply pick up where it was halted.

--
All the best

Keith Bainbridge

keithrbaugroups@gmail.com


Reply to: