Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

 

A cronjob is a script that will be executed by cron, a time-based job scheduler in Unix-like operating systems. This features allows you to execute system calls in regular intervals for example checking your emails every 5 minutes.

The configuration of the jobs is located in /etc/crontab (on Debian based distributions).

Before adding a entry you need to know how you can define the execution interval:

Code Block
# * * * * *  command to execute
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │
#
 
│ │ │ │ #
└─│─│─│─│────────── min (0 - 59)
# │ │ │ │

#   └─│─│─│────────── hour (0 - 23)
#

│ │ │
#	  └─│─│────────── day of month (1 - 31)
#		
│ │ #
└─│────────── month (1 - 12)
# │

#         └────────── day of week (0 - 6) (
0 to 6 are
Sunday to Saturday, for example 0 equals Sunday and 4 Thursday)

For example if you want to run a job every half hour you have to set the params 30 * * * *

or  0 0 1 1 * runs once a year at midnight in the morning of January 1

Webcron

If you don't have access to your system crontab, and don't want to use front end call as a trigger, you may use webcron service. 
There are many providers (e. g. https://www.easycron.com) that offers free or premium service. 

Pseudo-cron

The pseuco-cron feature from CONTENIDO adapts the general logic from the default cron feature. The difference between the two implementations is that cronjobs are controlled through a operating system timer and the CONTENIDO pseudo cron 'timer' is a call of the frontend.

...

The pseudo-cron feature is enabled as default setting. If you want to deactivate it (this is highly recommended if you want to run your files with real cronjobs instead) you have to set cfg['use_pseudocron'] = false; in the config.misc.php (line 36).

Core

...

cronjobs

NameDescriptionExecution time
advance_workflow.phpThis cronjob activates the next workflow step if the time limit is over-
linkchecker.phpChecks all links#02 1 * * * // (deactivated with #)
move_articles.phpMove articles at specified time

*/1 * * * * (periodically every minute)

move_old_stats.phpThis cronjob is used to move old statistics into the stat_archive table0 0 1 * *  (every first day in the month at midnight)
optimize_database.phpThis cronjob optimizes all database tables0 0 * * *  (every full hour)
run_newsletter_job.phpCronjob for newsletter plugin-
send_reminder.phpCronjob to send the reminder items.

*/5 * * * * (periodically every 5 minutes)

setfrontenduserstate.php Activate/deactivate frontend users by time.*/5 * * * * (periodically every 5 minutes)

...