What is my /tmp directory and can I delete its contents?

What is tmp used for?

The /home/cpanel_username/tmp directory in your cPanel account is used to store data related to your hosting account, most prominently files related to any statistic monitoring programs which may be enabled.

For example, the statistic programs of Awstats, Analog or Webalizer will record the data about your website visitors within the /tmp directory of your account.

My tmp directory is using up a lot of disk space

The data accumulated by the statistics programs can, over time, being to take up a noticeable amount of disk space. We'll look at ways to reduce this.

1. Disable unneeded Statistics Programs

To help limit further filesize growth, first consider rationalising the statistics programs in use on your website. For example, using Awstats, Analog and Webalizer all at once may be overkill! They do all produce equivalent information after all.

To disable Awstats, Analog or Webalizer:

  1. Login to cPanel
  2. Click the Metrics Editor button
  3. Then choose which programs you'd like to be used

Metrics Editor Icon

Consider using just one system for collecting data about websites visitors instead of two or three.

2. Prune Historical Statistics Data

Each statistics program creates files in its own sub-folder:

  • /tmp/analog
  • /tmp/awstats
  • /tmp/webalizer

Within each folder you will find timestamped files containing visitor data from that date, eg:

/tmp/awstats/awstats122020.example.com.txt

A file at this location contains the information gathered by awstats a particular day.

 

Tip: Click the Last Modified column in the cPanel File Manager to sort by the date.

 

Deleting these older files whose data you no longer require will remove that statistical information and reduce disk usage.

Is is safe to delete everything from the tmp directory?

In short yes. You will likely lose any statistics about websites visitors to date, but no permanent damage will be done.

If a statistics program is active then any files and folders it needs to operate will re-generate within 24 hours.

 

Further Reading

For more information on managing the disk usage on your cPanel hosting account, the Disk Usage page is invaluable.

  • tmp
  • 0 Users Found This Useful
Was this answer helpful?

Powered by WHMCompleteSolution