Installation and cron

IskFileGuardian1 min readPage 2 of 5
  1. Install the package via the Package Manager (MODX Extras).
  2. Check the system settings (namespace iskfileguardian): which folders to scan and what to exclude — see System settings.
  3. Open the component → “Core hashes” tab → “Download core”. Downloading the MODX distribution and building the reference takes a minute or more; if you skip this, the first core check does it.
  4. Enable notifications: email and/or Telegram.
  5. Add the cron jobs (below).

Cron

The scripts only run from the command line; the path is from the site root:

# site files — for example, every hour
0 * * * * php /path/to/site/core/components/iskfileguardian/elements/cron/scan_site.php > /dev/null 2>&1

# MODX core — for example, once a day
30 3 * * * php /path/to/site/core/components/iskfileguardian/elements/cron/scan_core.php > /dev/null 2>&1
  • scan_site.php — the first check (or the first after changing the hash algorithm) builds the baseline without notifications; after that it reports changes.
  • scan_core.php — compares the core with the reference for the installed version; if there is no reference, it downloads the distribution itself. If the check fails, it writes to the log and sends a notification.
  • A new run is skipped while the previous one is still working.

After a MODX upgrade the core reference is needed for the new version: click “Download core” or wait for the core check — it downloads it itself.