Let me explain the scenario.
I have a huge folder of documentaries on my internal HDD, and I also keep them backed up on my external drive.
Let's say that one day, I decide to reorganize my documentaries on my local drive into neat categories (folders). I don't add any new files, I just move 'em around locally.
So, my internal drive structure looks like:
blabla.../Documentaries/War/WW2 From Space.mp4
blabla.../Documentaries/Disaster/Runaway Train.mp4
Now, those same files already exist on my external (backup) drive, but are not yet neatly organized into categories/subfolders:
blabla.../Documentaries/WW2 From Space.mp4
blabla.../Documentaries/Runaway Train.mp4
So, when I now use rsync --update using local drive as src and ext drive as dest, it will think that /War/WW2 From Space.mp4 doesn't exist ! Because it is not under the same relative path on the external drive. So, it will (needlessly) copy it over under a new /War directory.
Can I tell rsync to be smarter and look for a src file anywhere in the dest Documentaries folder, and if found, simply move it around, creating new folders as needed, so it is organized the same way as the src (local Documentaries folder) ? This will save me a TON of time, because a copy operation is obviously much more time (and space) consuming than a simple move.
So far, I have written a Java program that does exactly what I want (Java is my go-to for stuff like this), but I'm wondering if I really need to reinvent the wheel here.
If not rsync, any other utility ?
I have a huge folder of documentaries on my internal HDD, and I also keep them backed up on my external drive.
Let's say that one day, I decide to reorganize my documentaries on my local drive into neat categories (folders). I don't add any new files, I just move 'em around locally.
So, my internal drive structure looks like:
blabla.../Documentaries/War/WW2 From Space.mp4
blabla.../Documentaries/Disaster/Runaway Train.mp4
Now, those same files already exist on my external (backup) drive, but are not yet neatly organized into categories/subfolders:
blabla.../Documentaries/WW2 From Space.mp4
blabla.../Documentaries/Runaway Train.mp4
So, when I now use rsync --update using local drive as src and ext drive as dest, it will think that /War/WW2 From Space.mp4 doesn't exist ! Because it is not under the same relative path on the external drive. So, it will (needlessly) copy it over under a new /War directory.
Can I tell rsync to be smarter and look for a src file anywhere in the dest Documentaries folder, and if found, simply move it around, creating new folders as needed, so it is organized the same way as the src (local Documentaries folder) ? This will save me a TON of time, because a copy operation is obviously much more time (and space) consuming than a simple move.
So far, I have written a Java program that does exactly what I want (Java is my go-to for stuff like this), but I'm wondering if I really need to reinvent the wheel here.
If not rsync, any other utility ?
Last edited: