Answers.Body: <p>Imagick uses the <code>/tmp</code> folder by default, but you can change it: <a href="https://github.com/ImageMagick/ImageMagick/issues/399#issuecomment-285793433" rel="nofollow noreferrer">https://github.com/ImageMagick/ImageMagick/issues/399#issuecomment-285793433</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-14T10:23:54.990Z
Answers.Text: Thank you Brad. Would you mind to answer to this important point → _When is it safe to delete them?_
Answers.UserDisplayName: Romain P.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-15T00:48:35.047Z
Answers.Text: Generally speaking, I'd say if it's in the tmp folder, I'd guess it'd be safe to delete. If a tmp file was currently in use, you'd get an error message saying so.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-14T04:55:57.533Z
Answers.LastActivityDate: 2020-02-14T04:55:57.533Z
Answers.UserDisplayName: Brad Bell
Body: <p>For several websites (Craft CMS 2 &amp; 3), servers ran out ot storage even if these websites were not storing a lot of assets.</p>
  
  <p>After looking for why, I ended up in the temporary (tmp/) folder of these servers (which is at a lower level of these vhosts), where I found there were a lot of Craft-related filed that were not purged.</p>
  
  <p>These are, for example:</p>
  
  <ul>
  <li>Imagick files (some of them have a size of ~500 Mb!)</li>
  <li>A lot of Twig PHP folders and files (which content looks very similar as found in <code>/storage/runtime/</code>)</li>
  </ul>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li>When and why these files are generated?</li>
  <li>Why they are not automatilcally deleted?</li>
  <li>When is it safe to delete them?</li>
  </ul>
  
  <p><em>To be more specific:</em></p>
  
  <ul>
  <li>Because I'm using Imgix, front-end image transforms are delegated to this remote service;</li>
  <li>In this case, I think that only the CP uses Imagick;</li>
  </ul>
  
Tags: <server><imagick><filecache><storage>
Title: Why is Craft storing so much temporary files inside the server tmp folder?
ThreadText: # Why is Craft storing so much temporary files inside the server tmp folder?
  
  (Asked by: username_0 on 2020-02-13)
  
  For several websites (Craft CMS 2 & 3), servers ran out ot storage even if these websites were not storing a lot of assets.
  
  After looking for why, I ended up in the temporary (tmp/) folder of these servers (which is at a lower level of these vhosts), where I found there were a lot of Craft-related filed that were not purged.
  
  These are, for example:
  
  * Imagick files (some of them have a size of ~500 Mb!)
  * A lot of Twig PHP folders and files (which content looks very similar as found in `/storage/runtime/`)
  
  **Questions:**
  
  * When and why these files are generated?
  * Why they are not automatilcally deleted?
  * When is it safe to delete them?
  
  *To be more specific:*
  
  * Because I'm using Imgix, front-end image transforms are delegated to this remote service;
  * In this case, I think that only the CP uses Imagick;
  
  **Tags:** server, imagick, filecache, storage
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-14. Score: 2
  
  Imagick uses the `/tmp` folder by default, but you can change it: <https://github.com/ImageMagick/ImageMagick/issues/399#issuecomment-285793433>
  
  > **Comments:**
  > **username_0**: Thank you username_1. Would you mind to answer to this important point → _When is it safe to delete them?_  
  > **username_1**: Generally speaking, I'd say if it's in the tmp folder, I'd guess it'd be safe to delete. If a tmp file was currently in use, you'd get an error message saying so.  
  
  ---
  
  