Coder Social home page Coder Social logo

dedup_files's Introduction

dedup_files

for file deduplication(文件去重)
本程序的原理是扫描目标目录的所有文件,计算他们的md5值,如果一样,说明是一个文件。
统计出来所有md5值后,找到副本数量大于1的文件,只保留一份副本,然后用这份副本做硬链接到其它的几个副本文件名处。
从而尝试释放空间。
由于FAT/FAT32/EXFAT等文件系统不支持硬链接,所以这样的文件系统是不被支持的,也就不用尝试了。
(当前一般windows都是ntfs文件系统,支持硬链接)
最初写来是用来给微信数据文件夹瘦身的,因为微信的各种文件转发,图片转发什么的,都是copy,不是hard link。
改成hard link后,个人的30G占用空间,一下子就少了10G。
当然非微信的目录也是一样的可以文件去重。

第一次执行时,它会自动生成一个dedup_files.ini的配置文件,
其中dirs里面指定了哪些目录是要扫描进行去重的,
cache_file:参数指定存放cache文件的路径,默认放在当前程序路径下
md5_key_file:以md5为key的hash dict,文件存放路径
ask_before_del:删除文件前,是否进行询问

dedup_files's People

Contributors

sunhanaix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.