Most active commenters

    ←back to thread

    Against /Tmp

    (dotat.at)
    140 points todsacerdoti | 11 comments | | HN request time: 0.874s | source | bottom
    1. tmountain ◴[] No.41913914[source]
    Things goes along with the author's "tmp cleanup" section, but I have lost valuable work on a number of occasions from hacking on random files that I created in /tmp under the assumption that they were throwaway junk files, only to reboot my machine a few hours later and have them automatically deleted by the OS. It's much safer and just as easy to use a "$HOME/tmp" dir as a junk drawer and then manually clean it up from time to time.
    replies(4): >>41913944 #>>41913967 #>>41914063 #>>41914729 #
    2. zimpenfish ◴[] No.41913944[source]
    Pro* tip: don't put your mSQL database file on /tmp on a Solaris box.

    Because at some point a few months later people will say "where did the database go?" and you'll have a lot of explaining and reconstruction to do.

    (mid 90s)

    replies(1): >>41914338 #
    3. Joker_vD ◴[] No.41913967[source]
    > valuable work

    > created ... under the assumption that they were throwaway junk files

    Don't leave your valuables in the office trash bins (they get cleaned every 3 hours), what else can I say?

    4. akdev1l ◴[] No.41914063[source]
    You can use /var/tmp for this purpose

    It is not cleared between reboots

    replies(2): >>41914167 #>>41914745 #
    5. SoftTalker ◴[] No.41914167[source]
    Depends on the OS. In OpenBSD, /var/tmp is a symlink to ../tmp and is so is cleaned on reboots and periodically.
    replies(1): >>41914576 #
    6. hulitu ◴[] No.41914338[source]
    I think this one was in the "Unix admin horror stories"
    replies(2): >>41914686 #>>41915525 #
    7. akdev1l ◴[] No.41914576{3}[source]
    https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.htm...

    Yeah it’s a Linux/FHS thing.

    8. zimpenfish ◴[] No.41914686{3}[source]
    Wish I'd read that before I did it then.
    9. ziml77 ◴[] No.41914729[source]
    It's best to assume that any directory which holds temporary files for applications will be cleaned up at any time. The whole point of those directories is to hold things that need to exist somewhere but are ephemeral.
    10. NekkoDroid ◴[] No.41914745[source]
    Do note that systemd does have a tmpfiles.d (terrible name nowadays, but that is besides the point) drop-in with an extra service that will clean out /var/tmp/ of unused files when they haven't been accessed within 30 days (all of a/m/ctime are checked). Same applies to /tmp/ but with 10 days. I don't know if the service is enable by default on any distros though, so assume it is unless otherwise ensured :)
    11. stevekemp ◴[] No.41915525{3}[source]
    Like those users who start with Linux, and later move to Solaris only to learn "killall" does something different there..

    In my defense I only did it the once.