English (United Kingdom)
Knowledge Base  >  Vik Rent Items  >  Automated Cron Jobs  >  How to schedule a Cron Job

In the Administrator section of the demo website of Vik Rent Items you can find an example of each Cron Job Scheduler: eMail Reminder.

These Cron Jobs could be executed manually from the back-end but this would require someone to log in to the back-end every day and click the Execute button. Since this function was made to automate some actions, it is recommended to schedule the jobs by using the Cron Utility from your Server Control Panel.

From the page 'Management - Scheduled Cron Jobs' of the back-end, you can get the Command for each job to be scheduled. There is a button 'Get Command' for each job configured. The system will suggest the command that should be set in your Cron Utility for executing the .php file that will do the actions configured.
Follow the instructions and click the button 'Download Executable File' to download the .php file that you should upload onto your server.

The cron jobs of Vik Rent Items are PHP files and if you uploaded them onto the root directory of your web-server, next to the main WordPress index.php file, you could execute them with your browser at a similar URL:

http://yourwebsite.com/name-of-the-downloaded-executable-php-file.php

This type of configuration may not be secure as anyone knowing the name of that file could execute your job at a time that you don't want it to be executed. Your hosting company should help you place the PHP Executable File at a directory above the public root directory. This will guarantee the best and most secure result.

Going back to the Command: Linux Servers require a command to execute your PHP Executable File that is usually similar to this:
/path/to/PHP/interpreter /path/to/PHP-Executable-File.php

If you are familiar with Bash or Linux Servers in general, then it won't be hard to configure the 'PHP Executable File' to be executed by your Cron Utility. Otherwise just tell your hosting company that you need to run/execute the 'PHP Executable File' downloaded from your back-end, at regular intervals like one time per day.

Last Update: 2020-11-06
Helpful?
This site uses cookies. By continuing to browse you accept their use. Further information