fmpp
is a command-line tool designed to monitor file integrity by tracking changes in directories or specific files. It uses SHA256 hashing to detect modifications and stores file metadata in an SQLite database. Optional systemd
service setup is available for continuous monitoring.
- Scan: Scan a directory and update the database with file hashes.
- Monitor: Continuously monitor a directory for changes (configurable interval).
- Check: Verify the integrity of files or directories against the database.
- Report: Display all tracked file records.
- Reset: Clear and reinitialize the database.
- Exclusion Patterns: Skip files or directories using glob patterns (e.g.,
*.log
). - Config File: Load settings from
/etc/fmpp/fmpp.conf
.
- A Linux distribution (e.g., Debian, Ubuntu, Fedora, Arch Linux, openSUSE).
- C++17-compatible compiler (e.g., GCC 8+).
- Dependencies:
cmake
,libssl-dev
(OpenSSL),libsqlite3-dev
(SQLite3).
The installation process is automated via the provided install-fmpp.sh
script, which builds and installs the fmpp
binary and default configuration.
This installs FMPP into /usr/local/bin using sudo. Run:
curl -sL https://github.com/cryptrunner49/fmpp/releases/latest/download/install-fmpp.sh | bash -s -- install --system
This installs FMPP into $HOME/.local/bin (and automatically adds it to your PATH if needed). Run:
curl -sL https://github.com/cryptrunner49/fmpp/releases/latest/download/install-fmpp.sh | bash -s -- install --user
curl -LO https://github.com/cryptrunner49/fmpp/releases/latest/download/fmpp
chmod +x fmpp
-
Clone or Download the Repository:
git clone https://github.com/cryptrunner49/fmpp cd fmpp
-
Make the Script Executable:
chmod +x install-fmpp.sh
-
Run the Installation:
./install-fmpp.sh install
- This script:
- Detects your Linux distribution (Debian, Ubuntu, Fedora, Arch, openSUSE).
- Installs dependencies using the appropriate package manager (
apt
,dnf
,pacman
,zypper
). - Creates necessary directories (
/etc/fmpp
,/var/lib/fmpp
). - Builds and installs
fmpp
to/usr/local/bin
. - Installs a default config file (
/etc/fmpp/fmpp.conf
).
- This script:
-
Verify Installation:
fmpp --help
- Requires
sudo
privileges. - Internet access is needed to install dependencies.
- The default config uses
/bin
as the monitored directory; adjust this in/etc/fmpp/fmpp.conf
if needed.
fmpp [--config <config_file>] [--db <database_file>] <command> [options]
--config <file>
: Specify a custom config file (default:/etc/fmpp/fmpp.conf
).--db <file>
: Override the database path from the config file.
-
Initialize Database:
fmpp init
-
Scan Directory:
fmpp scan /path/to/dir [--exclude "*.log"] [--exclude "build/*"]
-
Monitor Directory:
fmpp monitor /path/to/dir [--exclude "*.log"] [--interval 30]
- If no directory is provided, uses
monitor_dir
from the config file.
- If no directory is provided, uses
-
Check Integrity:
fmpp check /path/to/file_or_dir
-
Report Records:
fmpp report
-
Reset Database:
fmpp reset
Edit /etc/fmpp/fmpp.conf
to customize settings:
# File Monitor ++
db_path=/var/lib/fmpp/fmpp.db
monitor_dir=/var/www
exclude=*.log,build/*
interval=60
db_path
: Database location.monitor_dir
: Directory to monitor (used bymonitor
if no directory is specified).exclude
: Comma-separated glob patterns to exclude.interval
: Monitoring interval in seconds.
To run fmpp
as a background service, use the sample fmpp.service
file provided in the sample/
directory.
-
Create a User (Optional):
sudo useradd -r -s /bin/false -d /var/lib/fmpp fmppuser sudo chown fmppuser:fmppuser /var/lib/fmpp
-
Copy the Service File:
sudo cp sample/fmpp.service /usr/lib/systemd/system/
-
Enable and Start the Service:
sudo systemctl daemon-reload sudo systemctl enable fmpp.service sudo systemctl start fmpp.service
-
Check Status:
sudo systemctl status fmpp.service
-
View Logs:
journalctl -u fmpp.service
- Adjust
User
,Group
, andExecStart
infmpp.service
as needed (e.g., changefmppuser
to your user).
To remove fmpp
from your system:
-
Run the Uninstall Command:
./install-fmpp.sh uninstall
- This script:
- Removes the binary (
/usr/local/bin/fmpp
), config directory (/etc/fmpp
), and data directory (/var/lib/fmpp
). - Cleans the
build
directory.
- Removes the binary (
- This script:
-
Verify Removal:
command -v fmpp || echo "FMPP binary removed"
-
If you set up the service manually, remove it with:
sudo systemctl stop fmpp.service sudo systemctl disable fmpp.service sudo rm /usr/lib/systemd/system/fmpp.service sudo systemctl daemon-reload
- Command Not Found: Ensure
/usr/local/bin
is in yourPATH
(export PATH=$PATH:/usr/local/bin
). - Permission Issues: Check that
/var/lib/fmpp
is writable by the user runningfmpp
. - Dependencies Missing: Run
install-fmpp.sh install
again to ensure all packages are installed.
We welcome contributions! Check out our CONTRIBUTING.md for guidelines.
Distributed under the GPL-3.0 License. See LICENSE for more information.