google / skicka

Command-line utility for working with Google Drive. Join the mailing list at https://groups.google.com/forum/#!forum/skicka-users.
Apache License 2.0
1.3k stars 119 forks source link

Add `fsck` command to list (and possibly delete) duplicate files #42

Closed agoode closed 9 years ago

agoode commented 9 years ago

From the scenario in issue #18, it would be nice to be able to check the Google Drive folder in one go and get the full list of duplicate files, instead of having the command fail after a single duplicate is found.

Even better would be to have an option to automatically delete the duplicate files if other checks pass (at least checking if metadata and file contents are identical).

mmp commented 9 years ago

With 90321925b4fd94e36c119fec28fe9a742da498f8, there's now a 'skicka fsck-experimental' command. Given '--trash-duplicates', it will trash any duplicate files (when it seems to be appropriate to do so).

The logic is fairly straightforward, and I've tried to be careful, but definitely do a dry run without "--trash-duplicates" to make sure what it's planning on doing looks sensible.

If you try it out, let me know how it goes!