- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Organizing 60,000 folders
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Organizing 60,000 folders
You may find this https://www.bulkrenameutility.co.uk/ could help you
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.