Skip to content

Product docsLinux hosting

Scheduled tasks on Linux hosting: run a job on a schedule

Run recurring jobs on HyperDC Linux hosting: create a scheduled task for a PHP script in the client area, choose how often it runs and test it with Run Now.

  • Beginner
  • 10 min read
  • Updated

This guide is not available in your language yet, so it is shown in English.

On this page
  1. Step 1: Upload the script
  2. Step 2: Create the task
  3. Step 3: Test it
  4. Fetch an address or run a script
  5. Change or remove a task
  6. Troubleshooting
  7. Next steps

A scheduled task runs a job for you at set times, such as sending queued mail or cleaning up old files. On Linux hosting you create tasks in the Scheduled Tasks tab of your service page, and they run as your account's own user, never as root.

Step 1: Upload the script

Upload your script with File Manager, for example to private/cron.php. Outside httpdocs, visitors cannot open it.

Step 2: Create the task

  1. Open Scheduled Tasks and select New Task.
  2. Enter a Name you will recognise.
  3. Under What it does, choose Run A PHP Script.
  4. In Address or file, enter the path relative to your hosting account, such as private/cron.php.
  5. If the script needs them, enter its Arguments.
  6. Choose the PHP version and How often it runs:
    • Every Few Minutes: set the Minutes between runs, from 1 to 1439.
    • Every Hour.
    • Every Day, Every Week or Every Month: write the Time (HH:mm, server time), such as 03:00. A weekly task also asks for the Day, a monthly task for the Day of the month, from 1 to 28.
  7. Leave Enabled on and select Create Task.

The When column then shows the schedule, such as Every 15 minutes or Every day at 02:30.

Step 3: Test it

Select Run Now in the task's row, then read the Last run column for the time and the result.

Verify: the script did its job, such as writing the file or sending the message you expected.

Fetch an address or run a script

Under What it does, two more kinds of task are offered:

  • Fetch An Address opens a web address at the times you choose, such as https://example.com/wp-cron.php.
  • Run A Program runs a shell script (.sh) from your hosting account, with the Arguments you enter.

Applications you install in one click add the tasks they need here by themselves, such as Moodle's cron or Laravel's scheduler; see one-click PHP applications.

Overview shows how many tasks you have and how many your plan allows.

Change or remove a task

  • The pen icon in the task's row opens the same form; change it and select Save Task. Turn Enabled off there to pause the task without removing it.
  • The bin icon deletes the task. It stops running and is removed; the files it uses stay.

Troubleshooting

The task reports an error. Check the path in Address or file: it starts from your hosting account, so a script for your main domain starts with httpdocs/. Then run the script's page once in the browser, if it has one, to see its own message.

Next steps

Frequently asked questions

How often can a task run?

As often as every minute: choose Every Few Minutes and set Minutes between runs to 1.

Does a task run as root?

No. Every task runs as your hosting account's own user, inside its limits, never as root.

Can a task open a web address instead?

Yes. Choose Fetch An Address under What it does and enter the address, such as https://example.com/wp-cron.php. Run A Program runs a shell script (.sh) from your account.

Which clock do the times use?

The server's time, written as HH:mm, such as 03:00.

Where do I put the script?

Anywhere in your hosting account. Outside httpdocs, visitors cannot open it. Upload it with File Manager.

Generer passord

Please confirm