Code Monkey home page Code Monkey logo

sys-compare's Introduction

sys-compare

Check Filesystem Integrity via "Snapshots" containing hash of all files within specified directories.

Installation

cargo install --path ./

Modes

Usage: sys-compare <COMMAND>

Commands:
  create   Create a snapshot
  compare  Compare two snapshots
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

Create Snapshot

Usage: sys-compare create --root-dir <ROOT_DIR> --output-path <OUTPUT_PATH>

Options:
  -r, --root-dir <ROOT_DIR>        Directory to create snapshot from
  -o, --output-path <OUTPUT_PATH>  Snapshot output/save location
  -h, --help                       Print help

Compare Snapshots

Usage: sys-compare compare [OPTIONS] --left <LEFT> --right <RIGHT>

Options:
  -l, --left <LEFT>            left side of diff
  -r, --right <RIGHT>          right side of diff
  -s, --selection <SELECTION>  OPTIONAL: specify which change type specifically to return
  -c <COUNT_ONLY>              OPTIONAL: when using selection specify to return count only or not [possible values: true, false]
  -h, --help                   Print help

Example output

$ sys-compare create -r /etc -o ~/test.snapshot
Creating snapshot..
Total FileHash Entries 1891

$ sudo touch /etc/2

$ sys-compare create -r /etc -o ~/test2.snapshot
Creating snapshot..
Total FileHash Entries 1892

$ sys-compare compare -l ~/test.snapshot -r ~/test2.snapshot
Created: 1
Deleted: 0
Changed: 0

$ sys-compare compare -l ~/test.snapshot -r ~/test2.snapshot -s created
/etc/2
Created: 1

$ sys-compare compare -l ~/test.snapshot -r ~/test2.snapshot -s created -c
1

Development and Collaboration

Feel free to open a pull request, please run the following prior to your submission please!

echo "Run clippy"; cargo clippy -- -D clippy::all
echo "Format source code"; cargo fmt -- --check

sys-compare's People

Contributors

helloimalemur avatar konnek1ive avatar

Watchers

 avatar

sys-compare's Issues

expand comparison parameters

Rather than only comparing files by file hash, we can compare by file contents (which may allow a data diff), change/creation date etc, with file hash being the default.

verbosity flag

add verbosity flag

  • output file path as they are processed

exclude flag

add exclude flag, add parameters to blacklist

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.