glpi-agent icon indicating copy to clipboard operation
glpi-agent copied to clipboard

Deployment tasks & local cache size (Workdir / fileparts)

Open Tony710 opened this issue 2 years ago • 1 comments

Documentation

Yes, I read it

Solution search

Yes, I read it

Professional support

No response

Is your help request related to a problem?

When packages are deployed to windows computers with glpi-agent 1.3, files downloaded files are keeps locally in C:\Program Files\GLPI-Agent\var\XXXX\deploy(fileparts | workdir) folders. -> How glpi-agent manage files retentions & cleanup ? In my point of view, these directory need to be managed to prevent disk full.

What is the best way to limit, cleanup et manage de retention on these directory ?

Expected behavior

I would like to manage files retentions & cleanup on fileparts & workdir directories.

Actions you've considered

Usage of 'Rétention" parameter in Files definition of Packages don't seems to help... image

Additional context

glpi-agent 1.3 on windows 10

Tony710 avatar Jul 29 '22 16:07 Tony710

Hi @Tony710 when Deploy task is used, GLPI agent automatically schedules a "maintenance" event each few minutes to cleanup expired files until no more file can be cleanup. When the disk is about to be full (<2G of free space), the cleanup is forced. Did you encounter a situation where this didn't happen ?

g-bougard avatar Aug 08 '22 09:08 g-bougard

in my case: Win10 Pro 21H2 GLPI Agent 1.4 GLPI 9.5.9 Fsion inventory plugin 9.5+4.1

the workdir is not getting cleaned

In the meantime I'm doing another test to see if the issue is there only with successfull or failed tasks.

kintaro1981 avatar Oct 21 '22 07:10 kintaro1981

Hi there, just a reminder about windows systems, cleaning will fail if a file remained opened. Then you have to check if your actions can have leave a file opened from the workdir. Regarding the deploy/filepart tree, I just updated the agent so it tries to keep it as clean as possible. Actually, it can leave a lot of empty folders. Of course, downloaded file parts are not cleaned up if a job fails. So the downloaded file parts are kept as a cache for the next try until the retention time has expired. Also, file parts are kept until the retention time has expired if P2P is enabled on it. File parts are cleaned up sooner if the "maintenance" event detects less than 2G are remaining on the disk. The "maintenance" event rises each 2 minutes if agent runs as a service and file parts are kept. Anyway, please try next nightly build.

g-bougard avatar Oct 21 '22 12:10 g-bougard

Hello Jumping on this thread When you mention " GLPI agent automatically schedules a "maintenance" event each few minutes to cleanup expired files ...." Does it refer to the retention param in the deploy task ? What is teh definition of expired

The reason of this question is that i don't use this param and i can see tons of folders on my hosts

Frflamingo avatar Sep 11 '23 12:09 Frflamingo

Hi @Frflamingo

files should expire when no more required after a deploy task has been run. If you set the retention time, it tells only to keep the file parts that are downloaded to be kept a while. This is useful when using P2P or if the task will be run again before the set retention time (to avoid to download it again).

i can see tons of folders on my hosts

This is a really fuzzy description of your concern. But if you think the agent can be involved, first open a Q&A discussion.

g-bougard avatar Sep 11 '23 12:09 g-bougard