Cron Job
DevOps & AdminCron Job is a scheduled task on Unix-like systems that runs commands or scripts automatically at defined times or intervals. It is configured using cron expressions that specify minute, hour, day, month, and weekday, and it executes under a chosen user account with that user’s permissions. In hosting, cron jobs automate maintenance, data processing, and integrations without manual intervention.
How It Works
A cron job is managed by the cron daemon, which checks a schedule and triggers a command when the schedule matches. Schedules are written as five time fields (minute, hour, day of month, month, day of week) followed by the command to run. For example, a job can run every night at 02:00, every 5 minutes, or only on weekdays. Jobs can be defined per user (in that user’s crontab) or system-wide, and they run non-interactively, meaning they do not wait for user input.
Because cron runs in a limited environment, reliable jobs use absolute paths, explicitly set needed environment variables, and direct output to logs or email. Permissions matter: the job runs with the privileges of the account that owns it, so file access, database credentials, and network access must be configured accordingly. On many hosting control panels, cron jobs are created through a UI that writes the underlying crontab entry, sometimes with presets for common intervals.
Why It Matters for Web Hosting
Cron support affects how much of your site administration can be automated. When comparing hosting plans, check whether you can create cron jobs, how many are allowed, the minimum interval (some plans restrict to 15 minutes or more), and whether jobs can run long enough for backups or imports. Also consider access method (control panel vs SSH), logging options, and whether the host limits CPU time or background processes that could cause scheduled tasks to fail.
Common Use Cases
- Running application schedulers (for example, WordPress cron replacement, Laravel scheduler, or queue workers)
- Generating and emailing reports, invoices, or analytics summaries on a schedule
- Database maintenance tasks such as cleanup, exports, or rotating logs
- Automated backups and syncing files to external storage endpoints
- Refreshing caches, rebuilding search indexes, or pre-warming pages
- Triggering integrations: pulling data from APIs, processing webhooks, or sending batch notifications
Cron Job vs Scheduled Task (Control Panel)
A cron job is the underlying Unix scheduling mechanism, typically configured with a cron expression and executed by the OS. A control panel scheduled task is usually a user-friendly wrapper that creates cron entries for you, sometimes with guardrails such as interval presets, validation, and simplified logging. If you need precise timing, custom environment variables, or complex commands, direct cron configuration (often via SSH or advanced UI) is usually more flexible.