Before FusionInventory-Agent v2.3.18 the tasks that the agent executed and its order were hard-code defined: first the task Inventory, afterwards the task Deploy, afterwards the task NetDiscovery, and so on (sorry, this probably isn't the real order); the only way to modify that was installing or not the tasks or making use of --no-task option, that was all. But FusionInvenotry-Agent v2.3.18 changed this behaviour.
FusionInventory-Agent v2.3.18 introduced the new --tasks option with which it was possible not only to indicate which tasks to run but, also, in what order. But not only that, it allowed to run a task more than one time.
The --tasks option allows to do interesting things. Regarding to deploy packages, for example, it now allows to maintain an inventory more faithful to reality since it isn't necessary to wait for the agent refresh the inventory data so that deployed packages appear in FusionInventory for GLPI.
Now it's enough to set tasks=Inventory,Deploy,Inventory,... (don't forget the last three dots; it means exactly "and the other tasks") to be sure than a) FusionInventory for GLPI going to have got an up to date information before to try an hipothetical or possible Deploy task execution and b) FusionInventory for GLPI going to have got an up to date information after that hipothetical or possible Deploy task execution.
The new --tasks option introduces the advantage of modify the task schedules behaviour of the FusionInventory-Agent but it also introduces a side effect not so desirable. The side effect is an inefficient task execution and waste of resources. This is an example.
Set the --tasks option to Inventory,Deploy,Inventory,... (that is our configuration for more than fifteen thousand computers) is a good choice whether you have planned deploy packages because with it it's possible to maintain an inventory more faithful to reality. And yes, this is true, but you pay a high price in consumption of CPU, time and bandwidth, and not only in the side of the client. Why?. It's very simple. Most of time, the FusionInventory-Agent will not have to do any Deploy task so it will run two consecutive Inventory tasks with practically the same result; and that is a waste of resources.
But also it's possible to set the --tasks option to esoteric configurations like this: Inventory,Inventory,Inventory,.... And yes, I know this is a stupidity, but this stupidity may be possible.
I have thought about this problem during some time and I think that there could be a simple solution for both problems (that really are the same): keep track of what has been the last executed task and skip the execution of the next one whether it is of the same kind.
That is all. Regards,
Customer support service by UserEcho