TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
:navigation-title: Backend Module
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _backend-module:
|
||||
|
||||
==============================
|
||||
The "Scheduler" backend module
|
||||
==============================
|
||||
|
||||
.. contents:: Table of contents
|
||||
|
||||
.. _setup-check-screen:
|
||||
|
||||
The setup check screen
|
||||
======================
|
||||
|
||||
This screen has already been mentioned in the :ref:`Installation chapter <setup-check>`.
|
||||
It is mostly useful when setting up the Scheduler, as it indicates
|
||||
whether the CLI script is executable or not. When everything is
|
||||
running fine, it contains mostly one useful piece of information: when
|
||||
the last run took place, when it ended and whether it was started
|
||||
manually (i.e. from the BE module) or automatically (i.e. from the
|
||||
command line).
|
||||
|
||||
|
||||
.. _scheduled-tasks-screen:
|
||||
|
||||
The scheduled tasks screen
|
||||
==========================
|
||||
|
||||
This is the main screen when administering tasks. At first it will be
|
||||
empty and just offer a link to add a new task. When such registered
|
||||
tasks exists, this screen will show a list with various pieces of
|
||||
information.
|
||||
|
||||
.. figure:: /Images/BackendModuleMainView.png
|
||||
:alt: Scheduler main screen
|
||||
|
||||
Main screen of the Scheduler BE module
|
||||
|
||||
Disabled tasks have a gray label sign near the task name. A disabled task is a
|
||||
task that will not be run automatically by the command-line script,
|
||||
but may still be executed from the BE module.
|
||||
|
||||
A late task will appear with an orange label sign near the task name:
|
||||
|
||||
.. figure:: /Images/LateTask.png
|
||||
:alt: A late task in the Scheduler main screen
|
||||
|
||||
A late task in the main screen of the Scheduler BE module
|
||||
|
||||
|
||||
The task list can be sorted by clicking the column label. With every click it
|
||||
switches between ascending and descending order of the items of the associated column.
|
||||
|
||||
The table at the center of the above screenshot shows the
|
||||
following:
|
||||
|
||||
- The first column contains checkboxes. Clicking on a checkbox will
|
||||
select that particular scheduled task for immediate execution.
|
||||
Clicking on the icon at the top of the column will toggle all
|
||||
checkboxes. To execute the selected tasks, click on the "Execute
|
||||
selected tasks" button. Read more in "Manually executing a task"
|
||||
below.
|
||||
|
||||
- The second column simply displays the id of the task.
|
||||
|
||||
- The third column contains the name of the task, the extension it is
|
||||
coming from and any additional information specific to the task. It also shows
|
||||
a summary of the task's status with an icon.
|
||||
|
||||
- The fourth column shows whether the task is recurring or will run only
|
||||
a single time.
|
||||
|
||||
- The fifth column shows the frequency.
|
||||
|
||||
- The sixth columns indicates whether parallel executions are allowed
|
||||
or not.
|
||||
|
||||
- The seventh column shows the last execution time and indicates whether
|
||||
the task was launched manually or was run via the command-line script
|
||||
(cron).
|
||||
|
||||
- The eighth column shows the planned execution time. If the task is
|
||||
overdue, the time will show up in bold, red numbers. A task may have
|
||||
no future execution date if it has reached its end date, if it was
|
||||
meant to run a single time and that execution is done, or if the task
|
||||
is disabled. The next execution time is also hidden for running tasks,
|
||||
as this information makes no sense at that point in time.
|
||||
|
||||
- The last column contains possible actions, mainly editing, disable or
|
||||
deleting a task. There are also buttons for running the task on the
|
||||
next cron job or run it directly.
|
||||
The actions will be unavailable for a task that is currently running,
|
||||
as it is unwise to edit or delete it a task in such a case. Instead a
|
||||
running task will display a "stop" button (see "Stopping a task" below).
|
||||
|
||||
|
||||
|
||||
Note that all dates and times are displayed in the server's time zone.
|
||||
The server time appears at the bottom of the screen.
|
||||
|
||||
At the top of the screen is a link to add a new task.
|
||||
If there are a lot of tasks that appear late,
|
||||
consider changing the frequency at which the cron job is running (see
|
||||
"Choosing a frequency" above).
|
||||
|
||||
Occasionally the following display may appear:
|
||||
|
||||
.. figure:: ../../Images/MissingTaskClass.png
|
||||
:alt: A broken task
|
||||
|
||||
A scheduled task missing its corresponding class
|
||||
|
||||
This will typically happen when a task provided by some
|
||||
extension was registered, then the extension was uninstalled, but the
|
||||
task was not deleted beforehand. In such a case, this task stays but
|
||||
the Scheduler doesn't know how to handle it anymore. The solution is
|
||||
either to install the related extension again or delete the registered
|
||||
task.
|
||||
@@ -0,0 +1,119 @@
|
||||
:navigation-title: Console tools
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _console-tools:
|
||||
|
||||
=======================================
|
||||
Console tools to manage scheduler tasks
|
||||
=======================================
|
||||
|
||||
Console commands to manage scheduler tasks include :command:`typo3 scheduler:list`,
|
||||
:command:`typo3 scheduler:execute` and :command:`typo3 scheduler:run`.
|
||||
|
||||
You can display detailed help on these commands, by using the `--help` parameter to
|
||||
display the help:
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
vendor/bin/typo3 scheduler:list --help
|
||||
|
||||
.. group-tab:: Classic mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:list --help
|
||||
|
||||
See also: `Command usage in terminal environments <https://docs.typo3.org/permalink/t3coreapi:how-to-run-a-command>`_.
|
||||
|
||||
.. contents:: Table of contents
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:caption: Subpages
|
||||
:titlesonly:
|
||||
|
||||
*
|
||||
|
||||
.. _console-run:
|
||||
|
||||
Running the scheduler
|
||||
=====================
|
||||
|
||||
The command :command:`typo3 scheduler:run` is usually called by the
|
||||
`cron job <https://docs.typo3.org/permalink/typo3/cms-scheduler:cron-job>`_.
|
||||
|
||||
It looks for tasks that are **due**, and runs them. You can
|
||||
optionally target specific task IDs, force them even if not due, or stop them.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
vendor/bin/typo3 scheduler:run
|
||||
|
||||
.. group-tab:: Classic mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:run
|
||||
|
||||
.. seealso::
|
||||
`Running the scheduler: typo3 scheduler:run <https://docs.typo3.org/permalink/typo3/cms-scheduler:scheduler-shell-script>`_
|
||||
|
||||
.. _console-execute:
|
||||
|
||||
Executing scheduler tasks
|
||||
=========================
|
||||
|
||||
The command :command:`typo3 scheduler:execute` is a "manual fire" runner. You pick
|
||||
tasks (IDs or whole groups) and it **executes them on demand**, regardless of
|
||||
whether they are due. It can also prompt you interactively to choose.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Note the id of the task
|
||||
vendor/bin/typo3 scheduler:list
|
||||
|
||||
vendor/bin/typo3 scheduler:execute --task=<taskUid>
|
||||
|
||||
.. group-tab:: Classic mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Find the id of the task
|
||||
typo3/sysext/core/bin/typo3 scheduler:list
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:execute --task=<taskUid>
|
||||
|
||||
.. _console-list:
|
||||
|
||||
Listing all scheduler tasks
|
||||
===========================
|
||||
|
||||
Command :command:`typo3 scheduler:list` can be used to list all available tasks.
|
||||
This command basically displays the same information as the backend module
|
||||
:guilabel:`Administration > Scheduler`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
vendor/bin/typo3 scheduler:list
|
||||
|
||||
.. group-tab:: Classic mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:list
|
||||
@@ -0,0 +1,141 @@
|
||||
:navigation-title: Run the scheduler
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _scheduler-shell-script:
|
||||
|
||||
==========================================
|
||||
Running the scheduler: typo3 scheduler:run
|
||||
==========================================
|
||||
|
||||
The scheduler provides a PHP shell script designed to be run using
|
||||
TYPO3's command-line dispatcher. To try and run that script a first
|
||||
time, type the following command.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer-based installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
vendor/bin/typo3 scheduler:run
|
||||
|
||||
.. group-tab:: Classic installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:run
|
||||
|
||||
See also `TYPO3 Explained: Run a command from the command
|
||||
line <https://docs.typo3.org/permalink/t3coreapi:symfony-console-commands-cli>`_.
|
||||
|
||||
.. contents:: Table of contents
|
||||
|
||||
.. _scheduler-shell-script-help:
|
||||
|
||||
Show help
|
||||
=========
|
||||
|
||||
In order to show help:
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer-based installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
vendor/bin/typo3 scheduler:run --help
|
||||
|
||||
.. group-tab:: Classic installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:run --help
|
||||
|
||||
.. _scheduler-shell-script-options:
|
||||
|
||||
Providing options to the shell script
|
||||
=====================================
|
||||
|
||||
The shell scripts accepts a number of options which can be provided in any
|
||||
order.
|
||||
|
||||
.. _scheduler-shell-script-options-i:
|
||||
|
||||
`--task (-i)`
|
||||
-------------
|
||||
|
||||
To run a specific scheduler task you need to provide the uid of the task:
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer-based installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Run task with uid 42
|
||||
vendor/bin/typo3 scheduler:run --task=42
|
||||
|
||||
# Run tasks with uid 3 and 14
|
||||
vendor/bin/typo3 scheduler:run --task=3 --task=14
|
||||
|
||||
.. group-tab:: Classic installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Run task with uid 42
|
||||
typo3/sysext/core/bin/typo3 scheduler:run --task=42
|
||||
|
||||
# Run tasks with uid 3 and 14
|
||||
typo3/sysext/core/bin/typo3 scheduler:run --task=3 --task=14
|
||||
|
||||
The tasks will be executed in the order in which the parameters are provided.
|
||||
|
||||
.. _scheduler-shell-script-options-f:
|
||||
|
||||
`--force (-f)`
|
||||
--------------
|
||||
|
||||
To run a task even if it is disabled (or not scheduled to be run yet),
|
||||
you need to provide the force option:
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer-based installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Run task with uid 42, even if disabled
|
||||
vendor/bin/typo3 scheduler:run --task=42 --force
|
||||
|
||||
.. group-tab:: Classic installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Run task with uid 42, even if disabled
|
||||
typo3/sysext/core/bin/typo3 scheduler:run --task=42 --force
|
||||
|
||||
This will also run the task with uid 42 if it is disabled.
|
||||
|
||||
.. _scheduler-shell-script-options-v:
|
||||
|
||||
`--verbose (-v)`
|
||||
----------------
|
||||
|
||||
A single `-v` flag will output errors only. Two `-vv` flags will also output
|
||||
additional information:
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer-based installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Run task with uid 42, with detailed stack traces
|
||||
vendor/bin/typo3 scheduler:run --task=42 -vv
|
||||
|
||||
.. group-tab:: Classic installation
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Run task with uid 42, with detailed stack traces
|
||||
typo3/sysext/core/bin/typo3 scheduler:run --task=42 -vv
|
||||
@@ -0,0 +1,34 @@
|
||||
.. include:: /Includes.rst.txt
|
||||
|
||||
.. _deleting-a-task:
|
||||
|
||||
===============
|
||||
Deleting a task
|
||||
===============
|
||||
|
||||
When choosing to delete a task, a pop-up window will appear requesting
|
||||
confirmation.
|
||||
|
||||
Deleted tasks can be recovered in the module :guilabel:`Content > Recycler` if
|
||||
installed or by unsetting the deleted flag in the database.
|
||||
|
||||
.. _deleting-a-task-restoration:
|
||||
|
||||
Restoring a deleted scheduler task
|
||||
==================================
|
||||
|
||||
.. versionchanged:: 14.0
|
||||
Previously removed tasks can be restored via recycler.
|
||||
|
||||
If the system extension :composer:`typo3/cms-recycler` is installed, go to
|
||||
module :guilabel:`Content > Recycler`.
|
||||
|
||||
Choose the page root (page 0) in the page tree, all scheduler tasks are stored
|
||||
here.
|
||||
|
||||
You can use the field "Type" to filter for "Scheduler task" only.
|
||||
|
||||
.. figure:: /Images/RestoreTask.png
|
||||
:alt: Screenshot of the TYPO3 Backend Recycler module on the root page 0 with type "Scheduler task" selected
|
||||
|
||||
A task can be restored or permanently deleted in the recycler module
|
||||
@@ -0,0 +1,104 @@
|
||||
:navigation-title: Adding / Editing
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _adding-editing-task:
|
||||
|
||||
========================
|
||||
Adding or editing a task
|
||||
========================
|
||||
|
||||
Administrators can add or edit scheduler tasks in the backend module
|
||||
:guilabel:`Administration > Scheduler`.
|
||||
|
||||
When adding a new scheduler task a wizard will allow you to select a task
|
||||
type from several categories.
|
||||
|
||||
.. seealso::
|
||||
Developers can implement and register custom tasks:
|
||||
`Creating a custom scheduler task <https://docs.typo3.org/permalink/typo3/cms-scheduler:creating-tasks>`_
|
||||
|
||||
.. contents:: Table of contents
|
||||
|
||||
.. _information-screen:
|
||||
.. _adding-editing-task-wizard:
|
||||
|
||||
The scheduler task wizard
|
||||
=========================
|
||||
|
||||
.. figure:: /Images/EmptySchedulerModule.png
|
||||
:alt: Screenshot of an empty scheduler module, No tasks defined yet.
|
||||
|
||||
Click on "New task" to add a task
|
||||
|
||||
.. figure:: /Images/TaskCreationWizard.png
|
||||
:alt: Screenshot of the "New task" wizard in the scheduler backend module
|
||||
|
||||
Choose the task to be created
|
||||
|
||||
.. seealso::
|
||||
Developers can listen to event `ModifyNewSchedulerTaskWizardItemsEvent <https://docs.typo3.org/permalink/typo3/cms-scheduler:modifynewschedulertaskwizarditemsevent>`_
|
||||
to influence the items displayed here.
|
||||
|
||||
.. _adding-editing-task-form:
|
||||
|
||||
The scheduler task form
|
||||
=======================
|
||||
|
||||
When adding or editing a task, the following form will show up:
|
||||
|
||||
.. figure:: /Images/AddingATask.png
|
||||
:alt: Screenshot of the form to Create new Scheduler task on root level
|
||||
|
||||
Adding a new scheduled task
|
||||
|
||||
Some fields require additional explanations (inline help is
|
||||
available by moving the mouse over the field labels):
|
||||
|
||||
- A disabled task will be skipped by the command-line script. It may
|
||||
still be launched manually, as described above.
|
||||
|
||||
.. versionadded:: 13.3
|
||||
Similar to editing regular content elements, it is now possible to save
|
||||
scheduler tasks being edited via keyboard shortcuts as well.
|
||||
|
||||
It is possible to invoke the :kbd:`Ctrl`/:kbd:`Cmd` + :kbd:`s` hotkey to save a
|
||||
scheduler task, altogether with the hotkey :kbd:`Ctrl`/:kbd:`Cmd` + :kbd:`Shift` + :kbd:`S`
|
||||
to save and close a scheduler task.
|
||||
|
||||
.. _adding-editing-task-form-settings:
|
||||
|
||||
Scheduler task settings
|
||||
=======================
|
||||
|
||||
Some tasks allow additional settings to be made in the area :guilabel:`Settings`.
|
||||
These fields differ from task to task
|
||||
|
||||
.. _adding-editing-task-form-timing:
|
||||
|
||||
Task executions timing details
|
||||
==============================
|
||||
|
||||
.. figure:: /Images/TaskExecutionDetails.png
|
||||
:alt: Screenshot of tab "Timing" the scheduler task form
|
||||
|
||||
Choosing a frequency for a recurring task
|
||||
|
||||
- A task must have a start date. It defaults to the time of creation.
|
||||
The server's time appears at the bottom of the form.
|
||||
|
||||
- Task can be run a single time or recurring.
|
||||
|
||||
- The frequency needs be entered only for recurring tasks.
|
||||
It can be either an integer number of seconds or a cron-like schedule expression.
|
||||
Scheduler supports ranges, steps and keywords like ``@weekly``.
|
||||
See `en.wikipedia.org <https://en.wikipedia.org/wiki/Cron#CRON_expression>`_ for more information.
|
||||
See :php:`\TYPO3\CMS\Scheduler\CronCommand\CronCommand`
|
||||
and :php:`\TYPO3\CMS\Scheduler\CronCommand\NormalizeCommand`
|
||||
class references in the TYPO3 CMS source code for definitive rules.
|
||||
|
||||
- Parallel executions are denied for recurring tasks. They can be allowed by
|
||||
checking "Allow Parallel Execution"
|
||||
|
||||
If an error occurs when validating a cron definition, the
|
||||
Scheduler's built-in cron parser tries to provide an explanation about
|
||||
what's wrong.
|
||||
@@ -0,0 +1,69 @@
|
||||
:navigation-title: Grouping
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _grouping-tasks:
|
||||
|
||||
=======================================================
|
||||
Grouping tasks together in the Scheduler backend module
|
||||
=======================================================
|
||||
|
||||
In case of a high number of different tasks, it may be useful to visually
|
||||
group similar tasks together:
|
||||
|
||||
.. figure:: /Images/GroupedTasks.png
|
||||
:alt: Screenshot of the TYPO3 backend module scheduler with buttons regarding groups highlighted
|
||||
|
||||
Use button :guilabel:`New group` (1) to create a group, click on the title (2) to edit the group
|
||||
|
||||
You can sort and disable groups (3).
|
||||
|
||||
Unused groups are displayed at the bottom of the page. Only unused groups can
|
||||
be deleted (4).
|
||||
|
||||
When editing a group you can change its title and color.
|
||||
|
||||
.. figure:: /Images/GroupEdit.png
|
||||
:alt: Screenshot of the task group form
|
||||
|
||||
Color options can be customized by manipulating the
|
||||
:php:`$GLOBAS['TCA']['tx_scheduler_task_group']['columns']['color']['config']['valuePicker']['items']`
|
||||
array in your TCA overrides file.
|
||||
|
||||
.. code-block:: php
|
||||
:caption: packages/my-sitepackage/Configuration/Overrides/tx_scheduler_task_group.php
|
||||
|
||||
$GLOBALS['TCA']['tx_scheduler_task_group']['columns']['color']['config']['valuePicker']['items'][] = [
|
||||
'label' => 'My Color',
|
||||
'value' => '#ABCDEF'
|
||||
];
|
||||
|
||||
.. _grouping-tasks-edit:
|
||||
|
||||
Editing task groups
|
||||
===================
|
||||
|
||||
Scheduler task groups can be created, edited and deleted from the module
|
||||
:guilabel:`Administration > Scheduler`.
|
||||
|
||||
Technically they are records stored on the root page (pid=0). They can also be
|
||||
created, edited and sorted with module :guilabel:`Content > Records`.
|
||||
|
||||
It is also possible to create a new task group from within the edit task form by
|
||||
clicking on the `+` icon next to the task group select box.
|
||||
|
||||
.. _grouping-tasks-disable:
|
||||
|
||||
Disabling task groups
|
||||
=====================
|
||||
|
||||
You can use button :guilabel:`Disable group` to disable all tasks in a group
|
||||
at once.
|
||||
|
||||
.. figure:: /Images/GroupDisabled.png
|
||||
:alt: Screenshot a disabled task group, all tasks are marked as disabled by group
|
||||
|
||||
Use button :guilabel:`Enable group` to enable all tasks that had not been manually disabled.
|
||||
|
||||
Tasks in a disabled group, just like disabled tasks in general are not executed
|
||||
when the scheduler is called by the cron job. They can, however, be executed
|
||||
manually by clicking the :guilabel:`Run task` button.
|
||||
@@ -0,0 +1,25 @@
|
||||
:navigation-title: Administration
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _administration:
|
||||
|
||||
=================================================
|
||||
Backend administration in the "Scheduler" module
|
||||
=================================================
|
||||
|
||||
The Scheduler provides a BE module to manage tasks. It provides three
|
||||
screens: a setup check, an information screen and the main (default)
|
||||
one for actually managing the tasks.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 5
|
||||
:titlesonly:
|
||||
:glob:
|
||||
|
||||
BackendModule/Index
|
||||
EditTask/Index
|
||||
DeleteTask/Index
|
||||
GroupTask/Index
|
||||
StopTask/Index
|
||||
ManualExecution/Index
|
||||
ConsoleTools/Index
|
||||
@@ -0,0 +1,56 @@
|
||||
:navigation-title: Manual Execution
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _manually-executing-a-task:
|
||||
.. _executing-a-task-on-next-cronjob:
|
||||
|
||||
===========================================================
|
||||
Manually executing a task from the Scheduler backend module
|
||||
===========================================================
|
||||
|
||||
You can manually execute tasks from the BE module. After execution, each
|
||||
task shows success or failure.
|
||||
|
||||
* If a task was overdue, a new execution date is calculated.
|
||||
* If it was not overdue, the existing next execution date remains.
|
||||
|
||||
Running tasks:
|
||||
|
||||
* To run a single task, press the button in its row.
|
||||
* To run multiple tasks, select their checkboxes and press the button below the list.
|
||||
|
||||
There are two options:
|
||||
|
||||
* Run the task immediately. (Button 2 in the screenshot)
|
||||
* Schedule the task. (Button 1 in the screenshot) The selected tasks will
|
||||
then run on the next cron job.
|
||||
|
||||
.. figure:: /Images/ManualExecution.png
|
||||
:alt: Scheduler backend module with the buttons "Run task on next cron job" (1) and "Run task" (2) highlighted
|
||||
|
||||
Button 2 runs the task immediately, while button 1 schedules it fot the next cronjob run
|
||||
|
||||
.. _manually-executing-a-task-cli:
|
||||
|
||||
Manually executing a task from the console
|
||||
==========================================
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Note the id of the task
|
||||
vendor/bin/typo3 scheduler:list
|
||||
|
||||
vendor/bin/typo3 scheduler:execute --task=<taskUid>
|
||||
|
||||
.. group-tab:: Classic mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Find the id of the task
|
||||
typo3/sysext/core/bin/typo3 scheduler:list
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:execute --task=<taskUid>
|
||||
@@ -0,0 +1,92 @@
|
||||
:navigation-title: Stopping a Task
|
||||
|
||||
.. include:: /Includes.rst.txt
|
||||
.. _stopping-a-task:
|
||||
|
||||
===============================================
|
||||
Stopping a task in the Scheduler backend module
|
||||
===============================================
|
||||
|
||||
A task is marked as "running" while it runs. If the process crashes or
|
||||
is killed, the task may remain marked as "running". This is usually
|
||||
cleaned up automatically based on the maximum lifetime parameter,
|
||||
but manual cleanup may sometimes be needed.
|
||||
|
||||
.. figure:: /Images/StoppingATask.png
|
||||
:alt: Stopping a task
|
||||
|
||||
Stopping a running task from the main screen
|
||||
|
||||
Use the **stop** button to clear the execution mark for a task.
|
||||
This allows the task to run again.
|
||||
|
||||
Note: This does **not** terminate an actual running or hanging process.
|
||||
|
||||
.. _stopping-a-task-cli:
|
||||
|
||||
Stopping a task via console command
|
||||
===================================
|
||||
|
||||
You can also use a command to stop the task:
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. group-tab:: Composer mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Note the id of the task
|
||||
vendor/bin/typo3 scheduler:list
|
||||
|
||||
vendor/bin/typo3 scheduler:run --task=<taskUid> --stop
|
||||
|
||||
.. group-tab:: Classic mode
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Find the id of the task
|
||||
typo3/sysext/core/bin/typo3 scheduler:list
|
||||
|
||||
typo3/sysext/core/bin/typo3 scheduler:run --task=<taskUid> --stop
|
||||
|
||||
.. _kill-task:
|
||||
|
||||
How to handle a truly "hung" task
|
||||
=================================
|
||||
|
||||
If a task hangs or is stuck (for example due to an infinite loop or external I/O),
|
||||
then stopping it via TYPO3 (either UI or CLI) will only clear TYPO3’s internal flag.
|
||||
|
||||
The actual PHP process running the task will continue on the system
|
||||
until it finishes or the OS/PHP process manager kills it.
|
||||
|
||||
If a task keeps running indefinitely:
|
||||
|
||||
#. **Identify the process PID** You can find the hanging PHP process using
|
||||
tools like `top`, `ps aux | grep scheduler`, or via `systemctl status` if you run TYPO3 via a
|
||||
systemd service.
|
||||
#. **Manually terminate the PHP process** (for example, `kill <pid>`).
|
||||
#. **Clear the TYPO3 execution flag** by running:
|
||||
:command:`vendor/bin/typo3 scheduler:run --task=<taskUid> --stop`
|
||||
|
||||
.. warning::
|
||||
Manually terminating a scheduler process using `sudo kill <pid>` should only
|
||||
be used as a *last resort*.
|
||||
|
||||
Killing a running PHP process may interrupt database or file operations and
|
||||
leave the system in an inconsistent state.
|
||||
|
||||
Always analyze why the task is hanging before killing it.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ps aux | grep scheduler
|
||||
|
||||
# you might find something like this:
|
||||
www-data 12345 99.0 5.2 php vendor/bin/typo3 scheduler:run
|
||||
|
||||
# To force-stop that OS-level process:
|
||||
sudo kill 12345
|
||||
|
||||
# Then clear the mark again via:
|
||||
vendor/bin/typo3 scheduler:run --task=13 --stop
|
||||
Reference in New Issue
Block a user