I have a project with 500k users in CentOS. The picture file/directory structure was setup like this (yeah... i know):
user/0070/
this is the user ID / 1000, so that all users in the range of [70000-70999] are inside this directoryuser/0070/70909/
this is the user IDuser/0070/70909/p.jpg
profile picture (100x100)user/0070/70909/x.jpg
full size picture
I'm moving everything to a CDN, so I need to convert that structure into this:
user/70909.p.jpg
profile picture (100x100)user/70909.x.jpg
full size picture
Of course, the only way to achieve that in a period of time is to execute a script that renames and moves all files inside one single directory. Any ideas? Thanks!