2

I'm trying to make a locked down, auto-restoring system that will restore itself once every week. I'm wondering if /tmp and /var/tmp can be safely removed if the system is booted on a different partition (e.g. /dev/sda1 is mounted as the filesystem root and /dev/sda2 is mounted on /mnt, so would it be safe to remove /mnt/tmp and /mnt/var/tmp?).

I've tried searching for answers on this, but I've only found people asking if it's safe to delete when it is actively in use which I already know it is not.

naedozi
  • 21
  • 3
  • Okay, so if it is supposed to be cleared on reboot anyway, it should be safe to clear manually and then boot back into the system. – naedozi Mar 16 '18 at 16:45
  • 1
    @ThomasWard /var/tmp is not cleared on boot, it's supposed to persist across reboots. Only /tmp is cleared on boot. See e.g. https://askubuntu.com/questions/864383/is-it-safe-to-delete-files-from-var-tmp – Byte Commander Mar 16 '18 at 16:48
  • @ByteCommander note the "Assuming they're identical" portions of mycomments. :P – Thomas Ward Mar 16 '18 at 16:51
  • @user806799 You should not be touching /var/tmp, apparently. – Thomas Ward Mar 16 '18 at 16:51
  • Alright, I'll leave /var/tmp alone for now, but would it be safe to restore it on a daily basis as an alternative? I see systemd and kdecache files in my current one. I'll give that a try at some point and post on here how it goes. – naedozi Mar 16 '18 at 17:41

0 Answers0