On Tue, Oct 30, 2018 at 02:29:39PM +0000, Laurie Brown wrote:
On 30/10/2018 14:21, Chris Green wrote:
[SNIP]
Alternatively where can I put a file that will get cleaned out periodically (like /tmp at reboot)?
This question still stands, where can a program write temporary files so that apache can display them?
I use a tool call tmpreaper to clear out certain directories on a regular basis. It works really well in cron:
# Run tmpreaper to clear amavis 12h old temporary files every 4 hours # This is needed in /var/amavis/tmp as it fills up so quickly # 00 */4 * * * /usr/sbin/tmpreaper 12h --ctime /var/lib/amavis/tmp/ 2>&1
# The quarantine can be cleared of week old files daily 00 02 * * * /usr/sbin/tmpreaper 7d --ctime /var/lib/amavis/virusmails/ 2>&1
https://packages.debian.org/sid/tmpreaper
[Heed the / warnings!]
http://manpages.ubuntu.com/manpages/trusty/man8/tmpreaper.8.html
Thanks Laurie, though for my one-off case I could simply run find directly to removee files more than a few days old. However the less I have to customise my system the better and I include extra cron jobs as customisation (though fairly minor I agree).`