automatically clear old tmp/assets folders?

More
1 month 1 week ago #159439 by ArthurOne
ArthurOne created the topic: automatically clear old tmp/assets folders?
Hi!
Is there anyway to automatically clear/delete old folders from the tmp/assets directory ? I was wondering if there was any option in LimeSurvey 2.55 which will allow me to schedule the removal of old folders from the tmp/assets.

Thanks.

Please Log in to join the conversation.

More
1 month 1 week ago #159448 by tpartner
tpartner replied the topic: automatically clear old tmp/assets folders?
I have asked for a button to do that but the request was flatly denied - www.limesurvey.org/forum/can-i-do-this-w...r-tmp-folders#157696

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 month 1 week ago #159500 by ArthurOne
ArthurOne replied the topic: automatically clear old tmp/assets folders?
Thanks for answering!
That button would be really useful in my opinion although I get his point.

Please Log in to join the conversation.

More
1 month 1 week ago #159546 by LouisGac
LouisGac replied the topic: automatically clear old tmp/assets folders?

ArthurOne wrote: Hi!
Is there anyway to automatically clear/delete old folders from the tmp/assets directory ? I was wondering if there was any option in LimeSurvey 2.55 which will allow me to schedule the removal of old folders from the tmp/assets.

Thanks.



A PHP application is launched only when you call it (url or command line). It's not a deamon that runs all the time and that can perform an operation at a given date.

So any scheduled application related to a server maintenance (like deleting files in logs or temporary folders) should be done with the server cron jobs. Example for Ubuntu:
help.ubuntu.com/community/CronHowto

Another way to do could be to configure LimeSurvey so it uses the server tmp directory which is cleaned at every reboot. This setting can be overridden inside config.php:
github.com/LimeSurvey/LimeSurvey/blob/ma...ig-defaults.php#L638
(the LS subfolder in the tmp directory should be then reachable from Internet)

TPartner is speaking about a button to "refresh" the assets (to change the random string of the asset folder name, so it forces browsers to refresh its cache), it's pretty different.

Please Log in to join the conversation.

More
1 month 1 week ago #159555 by DenisChenu
DenisChenu replied the topic: automatically clear old tmp/assets folders?

LouisGac wrote: …

Another way to do could be to configure LimeSurvey so it uses the server tmp directory which is cleaned at every reboot. This setting can be overridden inside config.php:
github.com/LimeSurvey/LimeSurvey/blob/ma...ig-defaults.php#L638
(the LS subfolder in the tmp directory should be then reachable from Internet)

/tmp/ is rarely accessible via web access (and fortunately in general …).

I think /tmp can be used for runtimePath but not for assets :).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
1 month 6 days ago #159565 by jelo
jelo replied the topic: automatically clear old tmp/assets folders?

LouisGac wrote: Another way to do could be to configure LimeSurvey so it uses the server tmp directory which is cleaned at every reboot. [..] (the LS subfolder in the tmp directory should be then reachable from Internet)

tmp isn't always cleaned at every reboot. That depends on many settings. If tmp is pointing to a ram disk, a reboot cleans tmp. But if tmp is on a harddisk, tmp isn't always cleared via a reboot. Depending on the OS there are many different behaviors.

And placing LS assets in a subdirectory in the serverwide tmp directory seems to be a way to get more issues. Hopefully it is not the case on the SaaS offers by LS GmbH ;-)

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!