My root /tmp directory is surprisingly large, taking up a lot of my server. There's one old file from 2018, then the next oldest starts at 11/24/2020.
There are also some directories in /tmp, like /tmp/systemd-private-[random]-ea-php74-php-fpm.service-[random]/tmp that du -h -d 1 /tmp/ can't seem to read. It's been running for 15 minutes and can't seem to get past it.
I understand that I can safely delete the files within those directories, but not the directories themselves?
Is there any reason that I can't delete all of the files in /tmp that are older than, say, a week, except for MySQL sock? The files (excluding subdirectories) are cumulatively about 4G!
If I'm right that I can safely delete all of the files, is there a built-in way to automate that so that it doesn't fill up my server again?
There are also some directories in /tmp, like /tmp/systemd-private-[random]-ea-php74-php-fpm.service-[random]/tmp that du -h -d 1 /tmp/ can't seem to read. It's been running for 15 minutes and can't seem to get past it.
I understand that I can safely delete the files within those directories, but not the directories themselves?
Is there any reason that I can't delete all of the files in /tmp that are older than, say, a week, except for MySQL sock? The files (excluding subdirectories) are cumulatively about 4G!
If I'm right that I can safely delete all of the files, is there a built-in way to automate that so that it doesn't fill up my server again?