Code Monkey home page Code Monkey logo

bitrot's People

Contributors

faun avatar ggilder avatar golint-fixer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bitrot's Issues

Fix error behavior/testing

Rather than panicking in any of the Execute methods or subroutines, we should return an error. That way, we can assert against the error in test, and it will bubble up as the return value of parser.Parse() so that we can handle it properly in production.

  • Make sure the program exits with non-zero status on error
  • Make sure error message is printed to appropriate output (stderr?)

cc @faun

Add stats output

bitrot should print stats about read performance during its scan, both for general feedback and to evaluate the effect of configuration like #24

Add instrumentation

At a high level, measure time each invocation takes. Perhaps measure data throughput as well.

Handle permission errors better

Currently the program aborts if any permission errors are encountered. Perhaps it would be better to generate a partial manifest and report on those permission errors?

Checksum the manifest file itself

When a manifest file is written out, we should store a checksum of that file for additional verification. Possibly store in the filename itself?

[maybe] Add "checksum of checksums" feature for quicker validation

A manifest could have a top-level checksum computed from all the file checksums, so that two manifests could be compared quickly, with examination of the file-level information only necessary if the top-level checksums differ.

In practice this might not be worth it for manifests below a certain (probably high) number of entries, however.

Add strict comparison option

Right now comparison only fails if we detect corruption (so deletions/additions are ok). It would be useful to have a "diff" mode to validate that contents of two folders are the same (ignoring path moves).

Fix panic with go-flags

There must be an update to the behavior of go-flags because with the current version bitrot panics immediately.

Implement configurable parallelism

The stages of manifest generation, primarily checksumming, should be able to be split across a configurable number of threads for potential performance improvements.

Add functions to manage stored manifests

Per #36, we need user-accessible functions to manage stored manifests.

Should include:

  • List (show paths we have manifests for, show how many and what timestamps)
  • Remove (remove a particular manifest, or all for a given path)
  • Prune (remove manifests for paths that no longer exist)
  • Rotate? not the right name (delete old manifests logrotate style — needs config for how many/how long to keep)

"rotate" could be automatically triggered every time the program is run

Implement recheck command

  • Make sure there's an existing snapshot
  • Take a new snapshot
  • Generate diff between new and previous snapshots

Fix double output when no files are listed

For unchanged directory, output currently looks something like:

Comparing to previous manifest from 20200113T182158Z
SUCCESS

8 files compared.

Unchanged paths: 8
Added paths: 0
Deleted paths: 0
Renamed paths: 0
Modified paths: 0
Flagged paths: 0



Unchanged paths: 8
Added paths: 0
Deleted paths: 0
Renamed paths: 0
Modified paths: 0
Flagged paths: 0
Wrote manifest in /Users/gabriel/.bitrot/manifests

Add filetype or name exclusions

Prevent the application from generating checksums for .DS_Store files or similar by adding builtin exclusions. Perhaps adding a configuration file format to the home directory would make this configurable globally. Additionally adding the ability using a command line flag to exclude a filetype, directory or regular expression pattern.

Store manifests globally

Don't place inside analyzed folders — instead store in user's home dir (make configurable especially for testing).

Then we probably need some functions to manage stored snapshots - list, remove, etc. And snapshots should maybe be automatically deleted logrotate style. (Which needs configuration for how many to keep, which should also be stored in home.)

So perhaps there is a setting for config dir and for manifest dir. (Not necessarily user-configurable though)

Improve comparison output

  • Report totals in each category (number of adds/deletes/etc.)
  • Optionally print summary information first instead of last? (Better for emailed reports)
  • Print clearer summary with success/failure and total numbers of paths checked, categories: unchanged, added, deleted, moved, modified, flagged

CLI command to generate a manifest

Example:
bitrot generate [--exclude PATHS...] path

This would output a manifest JSON file in path/.bitrot/manifest-DATE-CHECKSUM.json

If a previous manifest exists, it will compare the new and old manifests and generate a report.

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.