× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Organizing 60,000 folders

mmmmd
Follower

Organizing 60,000 folders

Hi all,

 

We have a ReadyNAS 516 that we use as a file server.  We have a share that over the last few years has grown to 60,000.  This has made accessing the share a lot slower.  Almost all the folders in here are numeric.  We have two distinct numbering systems

 

5 digit folders  (37225, 37226 etc.)

6 digit folders  (150000, 150001 etc.)

 

I want to organize these into sub folders.

 

I want to leave all the folders over the last 6 months without touching anything.

 

Anything older than 6 months, I want to organize the folders into sub folders of 5,000 each.   The 6 digit folders need to be organized separately from the 5 digit folders.

 

Ideally, I want the end result to be folders like this

 

37000-42000   

150000-155000

 

Is there a way to do this without manually moving thousands of folders?  Any help would be appreciated.

 

thanks.

 

 

 

 

Model: RN51600|ReadyNAS 516 6-Bay Diskless
Message 1 of 4
StephenB
Guru

Re: Organizing 60,000 folders

You could potentially use a linux shell script or a windows powershell script.  But you'd need to test it carefully and verify the results, so it might not save much time.

 

If you have enough disk space on the NAS, I suggest copying everything as-is to a new share (using a NAS backup job).  Then if you make mistake, you'll still have everything preserved.  Alternatively, copy everything to a USB disk.

 

 

Message 2 of 4
bedlam1
Prodigy

Re: Organizing 60,000 folders

@mmmmd 

You may find this https://www.bulkrenameutility.co.uk/ could help you

Message 3 of 4
Sandshark
Sensei

Re: Organizing 60,000 folders

Creating and debugging a script to do the work could take as long as doing the move manually.  If you are familiar with regular expressions to make the file selections, then something like Total Commander can be of use.  But that is still interractive.

 

If you don't have space for another copy, a snapshot is also a good idea.

 

Note that if you are moving files to another share, not a another folder within the same share, that's another BTRFS sub-volume and it won't be a true move, it will be a copy and delete.  That will take much longer, and since the snapshopts of the old share will still contain the data, this type of "move" uses up space.  A move within a share just moves the pointer to it, not the data, so it's quick and the snapshot barely changes.

Message 4 of 4
Top Contributors
Discussion stats
  • 3 replies
  • 561 views
  • 0 kudos
  • 4 in conversation
Announcements