Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #247339

Re: moving dir with lots of files

From Keith Bainbridge <keithrboz@gmail.com>
Newsgroups linux.debian.user
Subject Re: moving dir with lots of files
Date 2022-04-18 10:50 +0200
Message-ID <Edvf3-9wux-1@gated-at.bofh.it> (permalink)
References <Edr1L-9tV5-1@gated-at.bofh.it> <Edrbr-9u3z-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

moving dir with lots of files Adriel Peng <peng.adriel@gmail.com> - 2022-04-18 06:20 +0200
  Re: moving dir with lots of files Bijan Soleymani <bijan@psq.com> - 2022-04-18 06:30 +0200
    Re: moving dir with lots of files Keith Bainbridge <keithrboz@gmail.com> - 2022-04-18 10:50 +0200

csiph-web