Cron Job is a tool that allows you to execute simple, repetitive tasks on a schedule automatically. Cron Job can be used for clearing cache, performing monitoring, running custom scripts, and so on.
To set up a Cron Job, open Websites → Manage, search for Cron Jobs on the sidebar and click on it:
Types of Cron jobs
First, you need to choose the type of Cron Job, be it PHP or Custom:
Selecting PHP will allow you to run .php files only, while Custom gives you the ability to execute scripts with different extensions and commands.
Command to run
Here, you can write the command you want to execute. For the PHP type that will be a path to a .php file that you want to execute, for the Custom Cron Job - any command or path to the file (usually non .php).
If you need to set up a Cron Job with special characters (like >/dev/null), make sure to check How to set up a Cron Job with special characters at Hostinger
It is recommended to test if the script works as intended before adding it to a Cron Job
The last step - specify, when exactly you want your Cron Job to be executed. You can choose from common options or set a schedule up manually:
Click on Save and your Cron Job will be created!
All your existing Cron Jobs can be found on the same page in the List of Cron Jobs section: