December 18, 20232 yr Hey fokes, I had a lot of my movies as bare files saved directly within one folder, but for sonarr they need to be in a folder with the same named so I tried to use a script I found on the internet to do this but massively messed up my 3,000+ movie library. The files are now stored in subfolders of the main folder with one word names like "after" for example, which would hold any movie folders with names starting with the word after. I need to move all of these subfolders back to the main folder else if I can't find a way I will have to delete my entire library and start over as I really messed up and don't know enough about scripts to do this. I assume it may be able to be fixed with a simple script but I really don't know enough to write one. Anything to point me in the right direction would be really really helpful. Thanks guys.
December 18, 20232 yr Hi, open Unraid console and go to /mnt/user/googledata/media/movies Then use the following command => find . -mindepth 2 -type f -print -exec mv {} . \; This will move all files from the subfolders of /movies/After, /movies/1, /movies/2, /movies/5th, etc. to /movies Duplicate filenames will be overwritten, so if you have same filesname for example /movies/After/Movie/File.mkv and /movies/After/Movie2/File.mkv it will end up with /movies/File.mkv (of previous folder Movie2) You can create a testshare first with some subfolders and testfiles to see, if the command is what you are looking for.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.