Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

automatically clear old tmp/assets folders?

  • ArthurOne
  • ArthurOne's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #159439 by ArthurOne
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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #159448 by tpartner
Replied by tpartner on 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.
The topic has been locked.
  • ArthurOne
  • ArthurOne's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 6 months ago #159500 by ArthurOne
Replied by ArthurOne on topic automatically clear old tmp/assets folders?
Thanks for answering!
That button would be really useful in my opinion although I get his point.
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 6 months ago #159546 by LouisGac
Replied by LouisGac on 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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #159555 by DenisChenu
Replied by DenisChenu on 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 , plugin development .
I don't answer to private message.
The topic has been locked.
More
6 years 6 months ago #159565 by jelo

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 ;-)

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose