How to create a cron job (scheduled task)
A cron job runs a command on a schedule — for example a PHP script every 5 minutes, a cleanup every night or a report every Monday. Cron jobs run as your own user, with the same files and limits as your websites.
Steps
- Log in to the control panel (
https://<server>:2083). - Open Cron Jobs in the menu (section Advanced).
- Under Add cron job, click in Schedule and choose a preset — Every 5 minutes, Every hour, Once a day, Once a week or Once a month — or type your own (see below).
- Enter the Command, for example
/usr/bin/php ~/public_html/cron.php. - Click Add.
The job appears in the list and runs from its next scheduled time.
The schedule format
Five fields separated by spaces: minute hour day month weekday. * means "every", */n "every n", and lists like 1,15 or ranges like 1-5 are allowed.
| Schedule | Runs |
|---|---|
*/5 * * * * | every 5 minutes |
0 * * * * | every hour, on the hour |
30 2 * * * | every day at 02:30 |
0 0 * * 0 | every Sunday at midnight |
0 0 1 * * | on the first day of every month |
0 9 * * 1-5 | at 09:00, Monday to Friday |
Times are the server's time.
Examples
WordPress, instead of running its scheduler on page visits:
/usr/bin/php ~/public_html/wp-cron.php >/dev/null 2>&1
Laravel's scheduler, every minute (schedule * * * * *):
cd ~/myapp && /usr/bin/php artisan schedule:run >/dev/null 2>&1
Good to know
- Your plan sets how many cron jobs you can have. The limit is shown at the top of the page.
- A command is one line of up to 1000 characters. Chain steps with
&&. - Add
>/dev/null 2>&1to commands that print output you do not need, or write it to a log file, for example>> ~/logs/cron.log 2>&1. - Cron jobs count toward your processor, memory and process limits (Resource Usage).
- Cron jobs do not run while the account is suspended.
- To change a job, delete it with Delete and add it again.
Common questions
Why do I get "Invalid cron field"?
One of the five fields uses something other than numbers, *, /, , and -. Names such as MON or @daily are not accepted; use 1 or 0 0 * * *.
How do I test my command first?
Run it in the Terminal (if your plan has shell access) exactly as you entered it, and check the output.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- How to use the terminal in your browser (SSH without a client)
Open a command line for your hosting account in the browser with Terminal, what you can run there, and the time and session limits that apply.
- How to change the PHP version of your website
Choose the PHP version for your whole hosting account or for one domain only, see which versions are installed, and what to check after switching.
- Resource Usage explained: disk, bandwidth, CPU and memory limits
Read the Resource Usage page: disk space by type, monthly bandwidth, file count, and the processor, memory and process limits that can slow a website.