Skip to content

Cron Jobs

Serghei Iakovlev edited this page Oct 29, 2017 · 8 revisions

Environment

All of the examples below use the following environment:

  • PHP: /usr/bin/php
  • FULL_PATH: /var/www/forum
  • LOGS_PATH: /var/www/forum/app/logs

Cron Jobs

Since the 3.2.0 version you can to use following Cron Jobs:

The sitemap.xml generator

# Sitemap generator to be scheduled for every hour 
1 * * * * [PHP] [FULL_PATH]/forum sitemap:generate >>[LOGS_PATH]/sitemap.log 2>&1

The robots.txt generator

# robots.txt generator to be scheduled for every month
* * 1 * * [PHP] [FULL_PATH]/forum robots:generate >>[LOGS_PATH]/robots.log 2>&1

Sending notifications to subscribers

# Notifications will be sent every 5 minutes (if any)
*/5 * * * * [PHP] [FULL_PATH]/forum notifications:send >>[LOGS_PATH]/notifications.log 2>&1

Index all existing posts in the Forum to elastic search

# Perform this task each four hours
0 4 * * * [PHP] [FULL_PATH]/forum searchengine:index >>[LOGS_PATH]/searchengine.log 2>&1