aaronpk / Aperture

Aperture is a Microsub server. Currently in beta.
https://aperture.p3k.io
Apache License 2.0
70 stars 5 forks source link

Clean up /tmp files #41

Closed sebsel closed 6 years ago

sebsel commented 6 years ago

I am not really a sysadmin, so maybe I'm missing a command I should be running, but: of my 50GB, 44GB was filled with aperturexxxx-files in my /tmp folder, freezing my server :)

A little search through the code spots these ones: https://github.com/aaronpk/Aperture/blob/9896b58bf9f504cce10578e948aacf0ab467c2ba/aperture/app/Listeners/EntrySavedListener.php#L119-L120

At the end of the method, there is an unlink(), but that does not seem to work (maybe you miss a fclose() here?) There is also this $resized one that does not get unlinked.

sebsel commented 6 years ago

Seems like it was a permission problem on my end: it couldn't create certain media-files, so it kept trying to download it. And since it crashed on that, it never came to unlink the tmp-files.

aaronpk commented 6 years ago

Looks like I missed cleaning up the resized files. The other ones look right, there's an fclose right after the file is written before it's used again later. I also had the crashing problem myself at one point, I'm not sure how best to deal with that though.