Hello,
I want to run one of the php methods in the class (defined in the datamodel) in the background.
Is it possible to do this or is it necessary to create a separate php file with the function and specify the path to it inside priv_backgroundtask?
I would also like to know where i can see the step-by-step creation of a background task for crons (the official documentation does not give an understanding of the full picture (or I'm just stupid))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I want to run one of the php methods in the class (defined in the datamodel) in the background.
Is it possible to do this or is it necessary to create a separate php file with the function and specify the path to it inside priv_backgroundtask?
I'm using:
- iTop 3.0.2-1-9957
- MySQL 10.1.48-MariaDB
- PHP 7.2.34
I would also like to know where i can see the step-by-step creation of a background task for crons (the official documentation does not give an understanding of the full picture (or I'm just stupid))
What exactly would you like to accomplish?
You could take a look at the background task for backups.
Don't let the name fool you, it can be configured to run once each day.
https://github.com/Combodo/iTop/blob/e72ed33a401e2a3f9d7f96c76466f8057bcee6ec/datamodels/2.x/itop-backup/main.itop-backup.php#L88
Update: actually, it may be possible by creating a custom class to define for "goal" or "working time"?
Last edit: Jeffrey Bostoen 2023-01-26