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:

  1. The cron initiates the configured task (scan or comparison)
  2. Self-chaining technology automatically breaks large jobs into batches
  3. Each batch triggers the next one until the job completes
  4. 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

  1. Go to Settings > Cron Configuration
  2. Enable Automatic Malware Scan
  3. Copy the generated secure cron URL
  4. 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

  1. Enable Automatic Snapshot Comparison
  2. Copy the comparison cron URL
  3. 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)