-
Notifications
You must be signed in to change notification settings - Fork 44
Fix(Crontab): highlight the need for proper crontab setup and CLI execution #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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".
@@ -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 | |||
|
|||
|
There was a problem hiding this comment.
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?
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`). |
There was a problem hiding this comment.
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.
This PR improves the documentation of crontab configuration for running GLPI CLI tasks.
Changes
www-data
,apache
, etc.) when setting up the crontab.cd
) before running the PHP command.sudo -u
to run CLI tasks manually as the correct user./usr/bin/php
) may be needed if it's not available in the environmentPATH
.