So I have a problem. I have WAY too many hard drives and backups from decades of computing. I just hoard everything. The issue is now I don’t know what I have duplicates of and what I don’t. or when I want to format an old external drive for something else, I’m not sure if I actually have a backup of it.

I just want a way to basically compare folders and see what files are missing or what are duplicates. I’m fine with CLI but I may prefer a GUI for this so I’m not deleting files by accident as easily…

I have searched around for this question but all the solutions seem way too complex for me.

  • Botzo@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 months ago

    rsync has a --dry-run / -n flag that would tell you which files would be synced. Combined with --archive /-a it runs recursively.

    That said, it’s assumes file paths are matching between source and destination, so if things are scattered, it might not work well.

    If you’re really scattered, I’d consider using a simple python script to walk directories and create a json file with results (maybe the sha256 for key and filename, size, absolute path, and created/modified stamps as fields). Then when you hit a duplicate key, you can dump the results and prompt a delete.

    Or something. I’m just spit balling here.

  • sainth@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 months ago

    I’m only familiar with CLI tools but at least for smaller directories diff works well. Say you have a backup directory and you want to see how it differs from a source directory:

    diff -rq /source/directory /backup/directory

    Another trick is to use find to look for a unique file to see where, if at all, it’s backed up:

    find /backup/directory -name unique-file-name.jpg

    • bridgeenjoyer@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      I could start with this !

      I love CLI where I understand it I just am not as trusting when dealing witharge amounts of files. Of myself.

  • Throbbing_banjo@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    I’m sure someone else has a better method, but I’d just use whatever file manager you have to consolidate everything into one folder and let the file system flag any dupes.

    Have ten movie folders on a bunch of different drives? Pick the biggest one, attempt to move the next biggest one into it, ignore all dupes, repeat.

    Again, though, there’s probably a better way

      • Clay_pidgin@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 months ago

        You could rsync everything into one pile, recursively walking through all directories. You’d need a way to smush duplicate files with different names, but also to catch the opposite case of different files with the same name.