Documentation

Everything you need to know about installing and managing WisPanel on your servers.

Cron Jobs

Cron Jobs

Schedule automated tasks and scripts to run at specific intervals.

Creating Cron Jobs

  1. Click Add Cron Job
  2. Configure schedule:
    • Minute: 0-59 or * for any
    • Hour: 0-23 or * for any
    • Day: 1-31 or * for any
    • Month: 1-12 or * for any
    • Weekday: 0-6 (0=Sunday) or * for any
  3. Enter command to execute:
    • PHP script: php /path/to/script.php
    • Shell script: /path/to/script.sh
    • Program: /usr/bin/program
  4. Set output:
    • Discard: Ignore output
    • Email: Send output to email
    • Save: Log to file
  5. Click Create

Common Cron Patterns

Pattern Meaning
0 0 * * * Daily at midnight
0 * * * * Hourly
0 2 * * 0 Weekly (Sunday 2am)
0 0 1 * * Monthly (1st day)
*/15 * * * * Every 15 minutes
0 6,18 * * * Twice daily (6am & 6pm)
30 2 * * * Daily at 2:30am

Managing Cron Jobs

View Job Details:

  1. Click cron job in list
  2. View:
    • Schedule pattern
    • Command
    • Last run time
    • Next run time
    • Status

Edit Cron Job:

  1. Click Edit
  2. Modify schedule or command
  3. Click Save
  4. Changes take effect immediately

Enable/Disable:

  1. Click toggle to disable
  2. Job no longer runs
  3. Re-enable anytime

Delete Cron Job:

  1. Click Delete
  2. Confirm deletion
  3. Job removed permanently

Viewing Logs

Check Execution:

  1. Click Logs for cron job
  2. View recent executions
  3. Last run time and duration
  4. Exit status (0 = success)

Troubleshooting:

  1. View command output in logs
  2. Check for error messages
  3. Verify script path is correct
  4. Test script manually first

Best Practices

  • Test commands manually before scheduling
  • Use absolute paths (not relative)
  • Run resource-heavy jobs during off-peak hours
  • Set appropriate output handling
  • Monitor cron logs regularly
  • Use meaningful job names
  • Document purpose of each cron
  • Implement error handling in scripts

Example Uses

WordPress Updates:

php /home/user/public_html/wp-cli.phar plugin update --all

Database Cleanup:

mysql -u dbuser -p'password' dbname < /path/to/cleanup.sql

Backup:

/usr/local/bin/backup-script.sh

SSL Renewal Check:

/path/to/ssl-check.sh

[Screenshot: cron-job-list.png] [Screenshot: cron-schedule.png] [Screenshot: cron-logs.png]