-
Notifications
You must be signed in to change notification settings - Fork 45
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
||
| 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 | ||
| ---------------------------------- | ||
|
|
@@ -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 commentThe 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`). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
|
|
||
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".