PeepSo Docs

Setting Up Cron Job

This article use images from third-party sources. CPanel is commonly used on majority of hosting services, but if you need to access Cron Job configuration differently, please consult your hosting provider.

PeepSo Configuration

PeepSo runs the built-in maintenance scripts and for the small sites, they are usually enough, but for the active and large sites, it is better to offload this process directly to server to improve performance. Some features like video uploads even require external cron job to be set. Before you start adding external cron jobs, please enable “External Maintenance Cron Job” in WP Admin -> PeepSo -> Configuration -> Advanced

PeepSo External Cron Configuration

Creating a New Cron Job

Cron is the utility software installed on Unix-like computer operating system. In website development it is used to trigger a certain action at fixed times, dates, or intervals.

Adding the cron job is commonly done through the hosting CPanel interface. If you’re not sure how to access it, please consult your hosting provider.

CPanel Cron Job Interface

  1. Common settings field allows you to select one of the commonly used configurations, like running the cron every minute, every 5 minutes, once a day etc. If you chose the common setting, the options in box #2 will be filled automatically.
  2. If you ever need to fine tune the cron schedule, you can do it here
  3. In this field, the command to execute should be entered. We will provide all, but you will need to modify them slightly to match the domain name or change the HTTP to HTTPS if you enable SSL certificate on your site.

Cron Command Structure

Every cron command consist out of three parts. The software that is going to be used (wget, curl), the cron command (url in the middle)  and additional arguments at the end (> /dev/null)
This third part of the cron command is particularly important.
We suggest using the one outlined bellow, but you can also opt for using different, or no arguments at all.
Examples:

  • Our example (> /dev/null) – Sends a cron output to /dev/null and notifies the email owner set in cron MAILTO when errors or debug messages occur
  • > /dev/null 2>&1 – Output is sent to /dev/null. No email is sent.
  • No argument – log file is created, email is sent to MAILTO address set in cron.

What is /dev/null?

It is just a special file on UNIX-like systems that accepts to be written but it never saves what’s written in it. Consider it be a book that is constantly being written, but it has no beginning, middle, or the end.

Maintenance Cron

Maintenance Cron is part of PeepSo Foundation Plugin. Setup scripts that clean up orphaned data, recounts hashtags, deletes temporary videos, delete items that are no longer needed. You can set the cron interval to run every 5 minutes and it works best for most sites.

Commands you can use:

wget http://domain.com/?peepso_process_maintenance > /dev/null
or
curl http://domain.com/?peepso_process_maintenance > /dev/null

Mail Queue

Mail queue is part of PeepSo Foundation Plugin. The email notifications that are queued will be sent in batches.
Before you setup the cron, make sure that the send mail function works properly, otherwise the email will stuck in the mail queue. You can set the cron interval to run every 5 minutes and it works best for most sites.

Commands you can use:

wget http://domain.com/?peepso_process_mailqueue > /dev/null
or
curl http://domain.com/?peepso_process_mailqueue > /dev/null

Video Conversion queue

Video Conversion queue is part of Videos Plugin. The cron will convert videos that are queued. Conversion process is starting from the oldest to newest, one video in one process. You can set the cron interval to run every 15 minutes or it depend on your server capability. Bear in mind that Video Conversion are an advanced experimental feature in a BETA phase – one that comes with a number of strict technical requirements and limitations.

Commands you can use:

wget http://domain.com/?peepso_convert_videos_event > /dev/null
or
curl http://domain.com/?peepso_convert_videos_event > /dev/null

GDPR Queue

GDPR queue is part of PeepSo Foundation Plugin. This cron triggers the execution for users who want to export their data. You can set the cron interval to run every 15 minutes.

Commands you can use:

wget http://domain.com/?peepso_gdpr_export_data_event > /dev/null
or
curl http://domain.com/?peepso_gdpr_export_data_event > /dev/null

Email Digest

Email Digest Cron is part of Email Digest Plugin. The cron creates and send email digest data for users. You can set the cron interval to run every 15 minutes.

Commands you can use:

wget http://domain.com/?peepso_email_digest_event > /dev/null
or
curl http://domain.com/?peepso_email_digest_event > /dev/null

Please note that curl must be installed on the server if you want to use curl commands

Using Third-Party Services To Schedule Cron Jobs

If for whatever reason, setting up the Cronjob is not a possibility on your server, you can choose to offload this task to third-party provider.
We recommend EasyCron that can provide advanced webcron solutions for all common and tricky needs.
EasyCron is in the business of handling Cron jobs since 2010 and have over 140.000 customers happily using their service.
You can see the full instructions on how to setup Cron jobs on EasyCron website by following this tutorial.