Merging folders with different names

10 replies [Last post]
GNUbahn
Offline
Joined: 02/18/2016

I have created a stupid problem for my self, which I hope someone can help me to solve.

Once I gathered all my pictures in one super folder, i.e. containing a large number of sub folders (like 2017, 2016, Skiing in Ax Les Thermes etc) and sub-sub folders (like 01, 02, 03, First day, Second day etc).

Of course I made a back-up of this 'Pictures' super folder. Hence, now I have two - and the stupidity begins:

In the original 'Pictures' folder I add new pictures. In the back-up 'Pictures' I have changes some folder names in order to make a batter overview of which picture to find where. Changing folder names included moving some files and deleting some folders. Hence the tree structure of the back-up super folder is slightly different from the original. And the original contains the exact same files as the back-up folder plus the once added. In order to tidy up my collection of pictures I have further more deleted some, but now I don't remember from which of the super folders.

The status is, that I have two super folders I would like to merge to one, keeping the tree structure of one of the super folders.

Is there a clever way to solve this problem?

onpon4
Offline
Joined: 05/30/2012

If I understand your problem correctly, you would have to use a script to check each individual file's hash (probably with shasum, but md5sum would probably also work), record that hash to a list, and only copy files whose hash has not yet been added to the list.

GNUbahn
Offline
Joined: 02/18/2016

That is my fear, too. I have more than 23,000 pictures. Since I wish to clear my computer in order to upgrade to Trisquel 8, my fist action would be to copy both the original super folder and back up super folder to a different hard drive. When asking grsync to 'alway checksum' and do a run-run, it worked for hours with not a single line of output.

Ignacio.Agullo
Offline
Joined: 09/29/2009

Sáb 08 Abr 2017 15:43:02 CEST:
>
> Is there a clever way to solve this problem?

If you only changed folders names (not pictures), I would
proceed as follows:

-Use a file manager that allows to split the window in two, i.e.
Nautilus allows to do this just by pressing F3.
-Use the dual panel to compare in an easy way the tree structure for
the two superfolders and to reproduce the changes from the backup
folder into the original superfolder.
-Now you have the same file structure for both superfolders, but with
new files on the original one. You need to do an incremental backup,
or if you don't have a program to do that automatically, you can just
delete the backup and make a new one.

------------------------------------------------------------------------
Ignacio Agulló · name at domain

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

GNUbahn
Offline
Joined: 02/18/2016

I may have to do something like this, but we are talking about hundreds of folders here. Ouch!

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

Searching "duplicate files" in the descriptions of Trisquel's packages returned four relevant options: fslint (with a GUI), rdfind, fdupes, and duff. After you get one single exemplary of each picture, I suggest you import them into a picture manager such as Shotwell, letting it copy the files in its usual structure (a hierarchy year/month/day based on the EXIF data). Actually, I believe Shotwell is able to detect duplicates during importation too. If so, it is not even necessary to use fslint/rdfind/fdupes/duff beforehand: just import both folders.

You can then remove the original files (but do back-up Sotwell's folder, e.g., using Trisquel's default "Backup" tool in its "System Settings"). You can then organize your pictures within Shotwell (e.g, tag them) and, in fact, only use Sotwell to deal with your pictures.

GNUbahn
Offline
Joined: 02/18/2016

In this case, I suppose I will loose the original file tree?

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

If you let Shottwell "copy the files in its usual structure (a hierarchy year/month/day based on the EXIF data)" and "then remove the original files", then, yes, the original tree organization is lost. However, the EXIF data (the date, maybe the GPS location, etc.) are still present. But you can also use one of the four generic tools I listed to get the tree you want and then ask Shotwell to import in place, without copying the files. See http://shotwell-project.org/doc/html/import-file.html

I am just not convinced that the file tree structure is that important. File managers are not really appropriate when it comes to organizing 23,000 pictures: a hierarchical organization is too rigid. That is why I suggest a program such as Shotwell, where you can select pictures and videos (like in a file manager) and add any number of tags to them: what is the event, the people on the picture, etc. You can rate the picture too. You can then search the pictures having some tag(s) and/or taken between two dates (which can be shifted for many pictures at once, in case the camera was not time) and/or having at least a given rate, etc. You can then launch a slideshow (with transitions) of the returned pictures. Basic edit functions are available too (to rotate/flip the picture, crop it, remove red-eye, adjust its brightness, its contrast, its colors, etc.) and they create new versions of the pictures (i.e., you can go back to the previous or even original version of the picture). See the whole documentation here: http://shotwell-project.org/doc/html/

willhill
Offline
Joined: 02/15/2017

As in everything else, work with a copy instead of the original. If you don't have enough disk space, tar or grsync everything to an external drive.

I think Digikam has a find duplicates feature that can be used to eliminate copies. I have never used it.

Once you get things in order, I suggest you organize things by date and event, subdivided by years. I explain the tools I use do to that here,

http://50.81.205.197/photo_album/chron/2012/2012_07_16-how_i_manage_photos/

Happy hacking!

GNUbahn
Offline
Joined: 02/18/2016

I have wanted for a long time to organise my pictures and future addition of pictures better. I will look into this, once my first problem (hopefully) is solved.

GNUbahn
Offline
Joined: 02/18/2016

Thanks for your suggestions.

I will now try to understand each of them fully before I act.