0

How often does tmp folder gets erased or cleared by Magento? or which events/triggers can I expect to wipe the contents of that folder?

Magento version: 1.9.0.1

So far I've noticed that most modules that use tmp folder have their own logic to remove files (created in tmp) related to the module.

dchayka
  • 1,291
  • 12
  • 20
  • 1
    You mean the systems `tmp` folder? I am just asking cause there is no `/var/tmp` as default folder. – codedge May 16 '16 at 21:45
  • 1
    @codedge I referred to Magento's `tmp` folder, but I guess your question answers my understanding of it. Since the folder will reside in `var` path, any time Flush Cache storage is triggered it will most likely be deleted as well. – dchayka May 16 '16 at 22:15
  • to make it clear: Flush Cache Storage does NOT delete /var/ – DM8 Mar 12 '18 at 19:30

1 Answers1

2

@codedge's question in the comments led me in the right direction to further understand and research my own question.

tmp folder will reside under var folder where it is highly possible to be removed by Magento at one point or another.

Quote from Alan Storm's website:

Mage::getBaseDir(‘tmp’);

The tmp dir is a temporary directory for safely outputting files into for immediate processing. The operating assumption of the tmp folder is that any developer can write to it and expect their file to stay around for a few minutes, without any expectation that it will be there tomorrow.

/var/tmp

Difference between Flush Cache and Fluch Cache Storage

The answer in the link above mentions the following:

Sometimes the cache location (like "/tmp/") or service (like Memcache) is shared with other applications. "Flush Magento Cache" removes only those entries that Magento reliably tracks as it's own. "Flush Cache Storage" clears everything but might affect other applications if they're using it.

Which (based on my research) is supported by the fact that most Magento modules which utilize tmp path/directory have their own logic to remove contents from the folder once they're no longer necessary.

Community
  • 1
  • 1
dchayka
  • 1,291
  • 12
  • 20