| Package | ISE_data_integrity v1.0.0 |
| Date | 2026-12-02 |
| System | Live only |
| Authors | Andrew.human & Claude.ai |
This is an hourly, read-only health check of the ISE stores in /var/www/html/ISE_Data. It answers two questions:
It never changes, moves, repairs or deletes anything.
| File | Install to | What it does |
|---|---|---|
ISE_data_integrity.sh |
/bin/ |
Cron entry point. Prints its version and the date and time, then runs the two scripts below. |
json_integrity1.sh |
/bin/ |
Loads every *.json at the ISE_Data root and prints OK <file> or BAD <file>. |
json_integrity2.sh |
/bin/ |
For post_store.json, pdf_store.json and misc_store.json, prints whether the store is a dict or a list, its entry count and its first keys. Then prints the first 400 characters of processor_checkpoint.json. |
ISE_data_integrity_manual.md |
wherever you keep manuals | This file. |
All three scripts need mode 755.
cp ISE_data_integrity.sh json_integrity1.sh json_integrity2.sh /bin/
chmod 755 /bin/ISE_data_integrity.sh /bin/json_integrity1.sh /bin/json_integrity2.sh
Add this crontab entry for root with crontab -e:
37 * * * * /bin/ISE_data_integrity.sh >> /var/log/ISE_data_integrity.log 2>&1
Minute 37 is chosen to stay away from jobs that start on the hour. If an indexer such as MediaIndexer writes to ISE_Data near :37, move the check to a minute when nothing else writes. A check that runs while a store is being written can show a false BAD.
Each hourly run looks like this:
ISE_data_integrity.sh v1.0.0 2026-12-02 05:58:59 UTC
json_integrity1.sh v1.0.0
OK misc_store.json
...
json_integrity2.sh v1.0.0
post_store.json dict 2 ['101', '102'] dict
pdf_store.json list 2 ['id_attach', 'name']
misc_store.json dict 1 ['9'] dict
checkpoint: {"last_id": 102, "stage": "done"}
BAD line: that store can't be read. Check it again by hand at a quiet moment. If it's still BAD, restore that store from the latest dated ISE_Data gzip.ERROR: python3 not found: the check didn't run. Your original one-liner hid this error and reported every store as BAD. These scripts report it plainly instead.json_integrity2.sh line: one of its four files is missing or unreadable. Line 1 of the same run will show which.Useful one-liners:
grep -c '^BAD' /var/log/ISE_data_integrity.log
awk '/^ISE_data_integrity.sh v/{h=$0} /^BAD/{print h" -> "$0}' /var/log/ISE_data_integrity.log
The first counts BAD lines ever logged. The second lists each BAD line with the date and time of its run.
/var/www/html/ISE_Data whatever folder it is started from. If that folder can't be entered, the script prints an error and exits with code 1./usr/local/bin to its search path so that python3 is found under cron. If python3 still can't be found, the script prints an error and exits with code 1 without reporting on any store.json_integrity1.sh checks every *.json at the ISE_Data root and never looks in subfolders.json_integrity2.sh reports on exactly four files: post_store.json, pdf_store.json, misc_store.json and processor_checkpoint.json.ISE_data_integrity.sh
print "ISE_data_integrity.sh v<ver> <date time zone>"
run /bin/json_integrity1.sh
run /bin/json_integrity2.sh
print blank line
json_integrity1.sh
print "json_integrity1.sh v<ver>"
add /usr/local/bin to PATH
cd /var/www/html/ISE_Data else print error, exit 1
python3 findable? else print error, exit 1
for each *.json:
loads as JSON? print "OK <file>" else print "BAD <file>"
json_integrity2.sh
print "json_integrity2.sh v<ver>"
add /usr/local/bin to PATH
cd /var/www/html/ISE_Data else print error, exit 1
python3 findable? else print error, exit 1
for post_store, pdf_store, misc_store:
dict -> print name, "dict", count, first 3 keys, type of first value
list -> print name, "list", count, first 8 field names of first entry
print "checkpoint:" + first 400 chars of processor_checkpoint.json
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-12-02 | First release. Built from Andrew's valid-JSON one-liner (json_integrity1) and the store-shape probe (json_integrity2), combined for an hourly cron job on Live. |