Astral 360 Astral Toolbox

Huge File Check

Scheduled scans of every home directory for oversized files and WordPress backups, with cleanup actions, a silence list and email reports.

Version 2.1.1 · Store extension, paid · requires PHP 7.4+ Scan every cPanel home directory for oversized files and WordPress backups, report and clean them up.

Huge File Check walks the server's home directories (/home, /home2, /home3 …, discovered automatically from cPanel) on a schedule or on demand. It flags oversized files in three categories, can delete them automatically by policy, keeps a run history with full reports, mails the report through the plugin's notifications, and gives you an interactive table to clean up flagged files by hand, with a silence list for known-good files.

Detection categories

Category Default rule
Error logs Files named error_log or debug.log larger than 50 MB
Large files Any file larger than 500 MB
WordPress backups File names matching provider patterns: Updraft (^backup_.*\.zip$), Backuply (^wp_.*\.tar\.gz$), Bividbackups (^wpclone_.*\.zip$), Duplicator Pro (^[0-9]{8}_.*_archive\.daf$, ^[0-9]{8}_.*_installer\.php\.bak$)

A file can fall in two categories (an error_log of 600 MB is also a large file): it shows on two rows, which change together, and counts once.

Language. The pages and the mailed reports are in English or French, as the rest of the plugin: the Language of Options › Settings › General (on Automatic, your WHM language; for a scheduled scan's report, root's). A run's report is written once, in the language of the scan that made it. Sizes follow the language too (1.2 GB, 1,2 Go).


Overview tab

Huge File Check — Overview

The Overview shows the latest run and lets you act on its files.

  • Next to the button, a badge says whether the scheduled scan is on (Scheduled: <days> at <time>) or not (Schedule off), with a link to the Configuration tab.
  • Run scan now starts the scan as a background process: it keeps running even if you close the tab. While it runs, a progress line says what it is doing (walking the home folders, with the number of candidate files found so far; sorting them; applying the deletion policies; writing the report) and since when. Only one scan runs at a time. Manual runs are unrestricted: the once-a-day limit applies to the schedule only. When the scan ends, the page reloads with the new run.
  • Counters: files examined, files to review (still present), flagged, deleted, trashed and silenced, under a line with the time of the last scan, its trigger (Scheduled or Manual) and the home folders it walked.
  • File table: one row per flagged file. Sortable columns: Modified, Age (days), Category, File (the path cut in the middle, so both the account and the file name show; the full path on hover), Size, Status (Present / Trashed / Deleted / Silenced), and the actions.
  • Bulk bar: tick rows (or the box in the header, for all), then Move selected to account trash or Delete selected. A click anywhere in a row's box cell ticks it.
  • Show silenced (N): silenced rows are hidden by default; this box shows them.

Per-row actions (files with status Present)

Action Effect
Silence (bell icon) Opens the silence window: pick a duration (1 to 180 days, pre-filled from the configured default) and an optional note (2 000 characters at most). The file is left out of reports, mails and automatic deletion until the silence ends.
Move to the account's trash Moves the file to the owning account's ~/.trash (the cPanel File Manager trash), where the account holder can review or restore it. A name already there gets a random suffix.
Delete for good (red icon) Permanently removes the file.

Every trash or delete, single or bulk, asks for confirmation first.

A silenced file with a note shows an ⓘ button next to its path: hover to read the note, click to change it (Save) or remove it (Remove the note).

Rows with only Silence

Some files cannot be removed from this page. Their row has no box, no trash and no delete button, only Silence, and a sentence under the path says why:

The row says Why
No account on this server owns this file Files are only removed with the rights of the account that owns them, never as root. A file owned by root, or by an account that no longer exists (often what a closed account left behind), has nobody to act for it.
This file has other names on disk Several hard links lead to the same file, as in a backup made with hard links. Deleting one name frees nothing, so the file stays.
This server does not allow changing rights The PHP that runs this plugin has the functions that switch to an account's rights turned off, so no file can be removed from here, whoever owns it.

Silence is the way out: the file stops coming back in the list and in the reports for as long as you choose. A deleting policy leaves these files in place too, and the report of the scan gives the same reason next to each one.

Safety guards on file actions

Actions are heavily hardened; useful to know when something is refused:

  • Only paths flagged by the latest run and still Present can be acted on: the page can never target an arbitrary path.
  • The path must canonically resolve under the scan root (no symlink or .. escape anywhere in the path) and be a regular file, checked again just before the operation.
  • The action runs with the rights of the account, never as root, and from inside the file's folder. If a folder was swapped for a link on the way, the action sees it landed somewhere else and refuses. A swap after that changes nothing.
  • A file in a folder with no account of that name is handled with the rights of its owner, and only if it still belongs to that owner once seen from inside the folder.
  • The trash refuses to operate if ~/.trash is a symlink; moved files are given back to the account (root-owned files stay root-owned). When the trash is on another disk and the file cannot be removed from its folder, nothing moves and no copy stays behind: the row says the file could not go to the trash.

History tab

Huge File Check — History

One row per past run: start time, trigger (Scheduled or Manual), examined / flagged / deleted / trashed counts, and whether the report was mailed.

Action Effect
View Opens the stored plain-text report in a window.
.txt / .html Download the report in either format.
Email Sends this run's report again through the plugin's notifications, whatever the "after a scheduled / manual scan" boxes say.
Delete Removes the run's line and its stored reports (asks first). The files it flagged are not touched.

Retention is a count: the newest N runs (30 by default, configurable) are kept; older lines and their reports go automatically.

Stopped scans

A scan stops at the next file when the extension is turned off, by you or because its licence ended. If it had already deleted files by policy, it keeps a line here with a Stopped badge, and its report lists what it went through, including what it deleted. The Overview tab shows the same badge and says the list is not complete: run a new scan to see everything. A stopped scan sends no mail. If it had deleted nothing, or if the extension was removed, nothing is recorded.


Configuration tab

Huge File Check — Configuration

Every field shows its default under it, with a Restore link while it differs. Save settings, in the bar at the bottom, saves the whole page and counts the unsaved changes.

Scheduled scan

The scheduled scan runs at most once a day, on the days you tick, at one time of day (by design: the time is a single hour and minute, never a list). Turn on / Turn off switches it; the status line says when it last ran and how long it took.

Field Default Rules
Days Tue, Thu One box per day, Monday to Sunday. At least one.
Time 22:45 Server time, 24-hour clock.

From 2.0.0 the plugin's task scheduler starts the scan (one line in /etc/cron.d/toolbox-scheduler for every extension), and only while the extension is turned on. Its runs are logged in /var/log/toolbox-scheduler.log. If the scheduler is missing (a core older than the extension), the page says so: update Astral Toolbox in Options › Version.

What the scan walks

Field Default Rules
Home folders Find them automatically Find them automatically asks cPanel which home partitions hold accounts (whmapi1 listaccts → partition), and adds the /home* folders found on the disk, at the start of every scan, so a new partition is covered with no edit here; the page lists what it finds now. List them myself walks exactly the folders you type (absolute paths, comma separated). That list is also the fallback when the automatic way finds nothing.
Folders skipped cache, tmp, sessions Folder names skipped at any depth.
Smallest file looked at 20 MB Smaller files are left out of every category.

System folders cannot be scan roots: /, /etc, /boot, /dev, /proc, /sys, /root, /run, /bin, /sbin, /lib*, /usr, /var, /tmp and anything inside them are refused: they hold what the system needs, not what accounts store.

Error logs, Large files, Backups

Section Fields
Error logs Flagged over (50 MB) · File names (exact names, error_log, debug.log) · Automatic deletion
Large files Flagged over (500 MB) · Automatic deletion
Backups One field per provider, one PCRE per line, matched against the file name only; grouped by CMS (WordPress today). Without ^ and $ a pattern matches anywhere in the name. A pattern that does not compile is skipped and logged, never fatal. · Automatic deletion, shared by every provider

Automatic deletion, applied by every scan:

  • Never: report only, the default for every category.
  • Delete when older than N days: only files whose modification date is older than that.
  • Delete at once: on detection.

Deletion is permanent. While any category deletes, a red box above the mail settings asks you to tick "I understand the files a deleting policy matches are removed for good.", and every save of the page needs it. Automatic deletion goes through the same hardened path as the buttons, and a silenced file is never deleted. "Older than" with no number of days is refused (1.x read it as 1 day).

A server with several home partitions. Automatic discovery covers /home2, /home3 … too: a deleting policy reaches every account on them. If a policy deletes, run a manual scan before the next scheduled one to see what it would reach.

Report by mail

The report lists each category and its files (silenced files left out). It goes through the plugin's notifications: Options › Settings › Email & notifications decides how mail leaves the server (through PHPMailer, to the server's local mail or an SMTP relay) and who receives it.

Field Default Notes
Mail the report on The extension's main switch for mail.
After a scheduled scan on
After a scan started with Run scan now off A manual scan mails only with this ticked.
Subject Large Files 100 characters at most, on one line. In the inbox, the subject is [<hostname>] Astral Toolbox - <hostname> - <this>; a report sent again from History adds "(re-sent)", the test report "(test)".

Send a test report sends a sample report with the settings as saved.

From 1.x. Huge File Check no longer sends mail on its own: its "fixed address (sendmail)" channel and its diagnostics log are gone. If you used that address, make it the recipient in Options › Settings › Email & notifications › Email recipient (the command-line installer says so during the update). A 1.x setup with both channels off still sends nothing.

History

Field Default Rules
Runs kept 30 1 at least. Older runs and their reports go beyond this count.

Silenced files

Field Default Rules
Silence for 30 days What the silence window offers. 180 days at most.

Under the field, a table lists every active silence (the soonest to end first) with its path, an ⓘ when it has a note, the days left, and Lift the silence. A silence that ends cleans itself up; the file is then flagged again by the next scan.


How the scan works

  • The scheduler and Run scan now both run the same command-line script (cron/scan.php) under cPanel's PHP, at the lowest priority. A lock on var/scan.lock lets one scan run at a time: a second start exits quietly. The lock belongs to the process, so it is released if the process dies.
  • The walk is a single find command (excluded folders pruned, -size +<min>c), read as a stream: memory stays flat even on very large /home trees. The fields are separated by NUL, so no file name can forge a line of the report.
  • The walk never enters the view of each account's home kept for jailed shell access (the virtfs folder at the top of a scan root), whatever the skipped names say: it shows the same files again. A row left there by an older scan offers only Silence, and is gone after the next scan.
  • The progress goes to var/scan-progress.json, which the page reads every 3 seconds; it says how the last scan ended (done, stopped, failed, interrupted).
  • Reports (.txt + .html) are stored per run under var/reports/, root only.

Install, update, removal

  • Install: the scheduled scan stays off, as before: it can delete files, so you turn it on.
  • Update from 1.x: the settings are kept as they are. The old cron file /etc/cron.d/toolbox-huge-file-check is retired once the plugin's scheduler is there, and the scheduler runs the scan at the same time on the same days. The files 1.x had and 2.0.0 moved are removed.
  • Remove: the settings, the history, the reports and the silences go with the extension's folder; the 1.x cron file and its log /var/log/toolbox-huge-file-check.log go too. Files already moved to an account's trash stay there: they belong to that account.

File map

Path Purpose
extensions/huge-file-check/config/settings.default.json Shipped defaults (overwritten on update)
extensions/huge-file-check/var/settings.user.json Your settings (kept by updates)
extensions/huge-file-check/var/history.json (+ .lock) Run records (capped list)
extensions/huge-file-check/var/reports/<id>.txt/.html Full report per run
extensions/huge-file-check/var/silenced.json Active silences and notes
extensions/huge-file-check/var/scan.lock / scan-progress.json One scan at a time / its progress
/etc/cron.d/toolbox-scheduler, /var/log/toolbox-scheduler.log The plugin's scheduler, shared by the extensions, and its log
/etc/cron.d/toolbox-huge-file-check, /var/log/toolbox-huge-file-check.log 1.x only: retired by the update, removed by Remove