13

The root filesystem ran out of space, so I'm deleting all the extraneous junk. I already deleted everything in /var/log and /var/cache/apt/archives and did sudo apt autoremove.

This /var/tmp is using 18.5 GiB. What is it used for? Is it safe to delete the contents?

UPDATE

I found these 2 swap files:

474M    10112015.tgz.swp
19G     10022015.tgz.swp

Those swap files were generated by opening tar files in vi.

Is there a way to limit the amount of storage space used by /var/tmp?

17

Filesystem Hierarchy Standard

5.15 /var/tmp : Temporary files preserved between system reboots

5.15.1 Purpose

The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.

Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp.


Yes, you can remove all files in /var/tmp/.

But 18Gb is far too much. Before deleting these files do have a look at what it holds and see if you can find a culprit. Otherwise you will have it at 18Gb again soon.

  • 3
    As a note, a very helpful command sequence for finding the cultprit is du -sch * | sort -h in /var/tmp/, then following the last few entries. – Shadur Dec 25 '16 at 18:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.