New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Can we delete File and folders under tmp Folder ?

Started by cloud, September 01, 2023, 07:58:55 PM

Previous topic - Next topic

cloud

Hi,

My server disk usage was increased recently no it was showing 87% So I don't know why it was like that I didn't have much website hosted under my server. I noticed there are many files under tmp Folder. In windows we mostly remove %temp% , Prefetch etc. So I need to know If there are folder or files which we can delete which will not effect our server or services. Please help me..

overseer

I wouldn't clear anything in /tmp -- look elsewhere for low hanging fruit. Typical offenders are log files (if you haven't enabled logrotate on them), user's IMAP trash folders, DB backups, and even daily backups if users have implemented a CMS-level (WordPress) backup solution -- so you wind up with large compressed archives in triplicate: daily, weekly, monthly).

You could search for files 100MB or larger:
sudo find / -xdev -type f -size +100M

Use your judgement to selectively delete some XL size files. And then likely you could truncate some of the log files to 0 bytes and start fresh, along with implementing logrotate:
truncate -s0 /var/log/spamd.log