Cron Setup
Set up automated scheduled scans and snapshot comparisons via cron jobs.
Cron Setup
Automate your security monitoring with scheduled cron jobs.
How It Works
The module provides secure, token-protected URLs that can be called by your server's cron scheduler. When triggered:
- The cron initiates the configured task (scan or comparison)
- Self-chaining technology automatically breaks large jobs into batches
- Each batch triggers the next one until the job completes
- An email report is sent when the job finishes
Self-chaining means even a Full Scan of 100,000+ files completes reliably on shared hosting where individual requests are limited to 30 seconds.
Setting Up Cron for Malware Scans
- Go to Settings > Cron Configuration
- Enable Automatic Malware Scan
- Copy the generated secure cron URL
- Add it to your server's crontab or hosting panel cron scheduler
Example crontab entry for a daily scan at 3:00 AM:
0 3 * * * curl -s "https://yourstore.com/module/himalwarescanner/cron?action=scan&token=YOUR_TOKEN" > /dev/null 2>&1
Setting Up Cron for Snapshot Comparisons
- Enable Automatic Snapshot Comparison
- Copy the comparison cron URL
- Add to your cron scheduler
Example for running a comparison every 6 hours:
0 */6 * * * curl -s "https://yourstore.com/module/himalwarescanner/cron?action=compare&token=YOUR_TOKEN" > /dev/null 2>&1
Security
- Each cron URL contains a unique security token generated per installation
- Tokens can be regenerated at any time (you'll need to update your cron entries)
- Cron endpoints only accept requests with valid tokens
Email Reports
After every cron run, a detailed email report is sent to configured addresses. Reports include:
- Scan type and duration
- Number of files scanned
- Threats found (with details) or clean confirmation
- Comparison changes found (modified, new, deleted files)
