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.
@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.