Score:2

Is there an easy way to find all files on an ubuntu server and load them along with path information into mysql?

py flag

I am using Ubuntu server 20.04 for OwnCloud and backups of multiple networked computers. I know I have many duplicate files on the server and would like to have one database of all files so I can quickly decide those to keep or delete.

I was thinking of using find and then loading them into mysql along with path,date, and size info. I'm looking for an easy way to load the data and am pretty familiar with SQL from there.

in flag
How would you define a "duplicate file"? MySQL may not be the best way to list dupes as you may have multiple configuration or profile files for different applications that share the same name. Or are you trying to find duplicate files in the OwnCloud directories so that you can have multiple MySQL entries point to the same source file on disk?
mchid avatar
bo flag
Have you seen [this similar question](https://askubuntu.com/questions/3865/how-to-find-and-delete-duplicate-files)? If so, please let us know what you think or if you've considered or tried any of these methods.
CncJerry avatar
py flag
I tried fdupes and there was another utility but one seemed to take forever with one directory. I might not have given it much of a chance. I'd like to find things like 'picture_backup' vs 'picture backup' vs 'backup pictures', any of which might contain the same data. That's why I was thinking if I had an SQL directory of this system I'd have more flexibility. There are about 50TB of files on this server now, many 400GB backups of pictures with the same data but different dates, some music, large VOB files, typical data dump in ZFS pools that got out of hand.
Raffa avatar
jp flag
Concerning `find` printing paths, sizes and modification dates of files, you cad try `find -type f -printf "%p %k %Ts\n"` ... see the (*-printf format*) part in [man find](https://manpages.ubuntu.com/manpages/jammy/en/man1/find.1.html)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.