How long a task stays in Done state

I see after completion task id gets deleted, I want to know how long a task stays at Done state and we will able to go and fetch its task id from gvm CLI commands. I am running a script where I am checking a task status for a task after every 5 min, in some of the instances I see before I go and check for the status, the task got deleted by some reason and I see an error in my code saying “failed to find task ids”

A task is “done” until the status is deliberately changed. If I understand you correctly your task gets deleted by a reason unknown to you. To find out why this happens try checking the logs. I can’t think of a mechanism that automatically deletes tasks, I’m sorry.

2 Likes

There is not auto deletion of tasks. If a task gets deleted there must be some user interaction or scripting involved.

But I can image you are mixing up tasks and reports. Reports are generated from a running task and they can be deleted automatically. Every task has a setting for the auto deletion. Take a look at the Auto Delete Reports option of the task dialog https://docs.greenbone.net/GSM-Manual/gos-5/en/scanning.html#creating-a-task

3 Likes