Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions source/modules/configuration/crontasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ Configure CLI mode
To run CLI mode tasks, you will need to configure your external task scheduler to call GLPI's `front/cron.php` file periodically.
It is recommended to have it run every minute to ensure that actions that are ready to run, get ran as soon as possible.

For Linux/MacOS, you should add the following to the web server's user's (www-data, apache, etc) crontab:

::

* * * * * php GLPI/front/cron.php

For Linux/MacOS, you should add the following to the web server's user's (**www-data, apache, etc**) crontab:

::

* * * * * www-data cd GLPI/front && php cron.php
Comment on lines +22 to +26
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either you use the user crontab, and you do not to specify user name, or you use the global crontab and you must add the user name to use for run.
Seems inconsistent here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be OK to document both options separately as some user may want to manage all "system" crontabs together and not use the web server user's crontab.

I don't see the functional difference of changing the actual command from "php GLPI/front/cron.php" to "cd GLPI/front && php cron.php".


You will need to replace `GLPI` with the path to your GLPI folder.
You may also need to replace `php` with the full path to your php binary if it is not in the PATH.
You may also need to replace `php` with the full path to your php binary if it is not in the PATH (`/usr/bin/php`).

Force execution of action from CLI
----------------------------------
Expand All @@ -33,7 +37,15 @@ To execute a specific action from the command-line, you can run (for mailgate ac

php GLPI/front/cron.php --force mailgate


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe duplucating the same remarks should be avoid addign a paragraph on cron configuration independant of the way it's run?

For Linux/MacOS, you should should use the web server's user's (**www-data, apache, etc**):

::

sudo -u www-data php GLPI/front/cron.php --force mailgate

You will need to replace `GLPI` with the path to your GLPI folder.
You may also need to replace `php` with the full path to your php binary if it is not in the PATH (`/usr/bin/php`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should suggest replacing it with the path to the specific version of PHP loaded in the web server for GLPI, whether that be the Apache module, FPM, etc.


Forcing the action to run will ensure it is run even if it is not scheduled to run again yet.

Expand Down