All Collections
Cron Jobs
How to Set up a Cron Job at Hostinger
How to Set up a Cron Job at Hostinger

Configuring a Cron Job at Hostinger

Updated over a week ago

A Cron Job is a powerful tool that automates the execution of simple, repetitive tasks on a set schedule. With Cron Jobs, you can easily handle various activities such as cache clearing, monitoring, and running custom scripts, among other tasks.

To set up a Cron Job, open Websites → Manage, search for Cron Jobs on the sidebar and click on it:

The Cron Jobs menu option

Before adding a script to a cron job, it's recommended to test it and ensure it works as intended💡

To create a new Cron Job, enter the following information:

  • Type - select PHP to run a .php file. Otherwise, select Custom if you want to execute scripts with different extensions and commands, as well as to use special characters

  • Command to Run

    • For PHP cron jobs - the path to the .php file that you want to execute

    • For the Custom cron jobs - any command or path to the file, usually non .PHP

  • Schedule - specify when exactly you want your Cron Job to be executed. You can choose from common options or set a schedule up manually:

The scheduling options for cron jobs

Click on Save, and your Cron Job will be created. It will start executing as scheduled.

You can find all your existing Cron Jobs on the same page in the List of Cron Jobs section, where you can view their output or delete them:

The List of Cron Jobs and their options

Additional Resources

Did this answer your question?