Skip to content
xYnta
Go to websitexynta.com
Search
EN

Setting up a cron job on your hosting package

Updated on

With a cron job you have a command or PHP script run automatically at set times, for example every 15 minutes or every night at 03:00.

Web Hosting (DirectAdmin)

Also for Reseller Hosting.

  1. Log in to DirectAdmin via Single Sign-On from Mijn xYnta, or at https://yourdomain.nl:2222.
  2. Under Advanced Features, click Cron Jobs.
  3. At the top right, click CREATE CRON JOB.
  4. Enter the schedule under Minute, Hour, Day of Month, Month and Day of Week (see the examples below). A * means "every". After Cron job will run:, DirectAdmin shows in words when the job runs.
  5. Under Command, replace the text that is there with the command, for example php $HOME/domains/yourdomain.nl/public_html/file.php for a PHP script, or wget -O /dev/null https://yourdomain.nl/file.php to request a page of your website.
  6. If you do not want to receive an email after each run, click PREVENT E-MAIL. DirectAdmin then adds >/dev/null 2>&1 to your command.
  7. Click CREATE.

The cron job then appears in the list under Cron Jobs.

WordPress Hosting (Plesk)

  1. Log in to Plesk at https://whs1.srvnl.nl:8443. You can find your server name in How can I find the server name of my hosting package?
  2. On the Dashboard tab, under Dev Tools, click Scheduled Tasks.
  3. Click Add Task.
  4. Under Task type, choose what the task does: Run a command, Fetch a URL or Run a PHP script, and enter the command, the address or the script below it.
  5. Under Run, choose how often the task runs (for example Daily) and at what time. With Cron style you specify a schedule yourself.
  6. Under Notify, choose whether you want an email: Do not notify, Errors only or Every time.
  7. Click OK.

With Run Now you try out the task straight away; Plesk then reports whether it succeeded.

The Create Cron Job form in DirectAdmin
Create Cron Job in DirectAdmin: the five time fields are set to * (every minute).
The Schedule a Task form in Plesk
Schedule a Task in Plesk, with Task type, Command and Run.

Example schedules

whenMinuteHourDay of MonthMonthDay of Week
every 15 minutes*/15****
every day at 03:0003***
every Monday at 01:15151**1

Video

Setting up a cron job in DirectAdminYouTube

Related articles