Temporary Files - Unix

This is a discussion on Temporary Files - Unix ; Where is a good place to write temporary files for evaluation that will be deleted once the evaluation has been completed? Are there standard directories that enough permission for users on the server? For example, /tmp...

+ Reply to Thread
Results 1 to 11 of 11

Thread: Temporary Files

  1. Temporary Files

    Where is a good place to write temporary files for evaluation that
    will be deleted once the evaluation has been completed? Are there
    standard directories that enough permission for users on the server?
    For example, /tmp

  2. Re: Temporary Files

    On Thu, 2 Oct 2008 08:58:29 -0700 (PDT),
    John Doe wrote:
    > Where is a good place to write temporary files for evaluation that
    > will be deleted once the evaluation has been completed? Are there
    > standard directories that enough permission for users on the server?
    > For example, /tmp


    So, what are you looking for that you're not finding in /tmp?

    If it's the auto-deletion, common strategies include running a cron job
    every so often that deletes files older than some time period. It is
    perfectly possible to create and use an alternate temporary directory
    for some specific purpose so that it doesn't interfere with the regular
    use of /tmp. There is of course no standard for that.

    If you want to pin it down to ``once ${action} has been completed'',
    then how is the system going to discern that? What if multiple
    ${action}s run concurrently? You might end up sweeping temporaries
    right from under a running task.

    Asking a more specific question enables more specific answers.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  3. Re: Temporary Files

    On Oct 2, 11:05*am, jpd wrote:
    > On Thu, 2 Oct 2008 08:58:29 -0700 (PDT),
    >
    > John Doe wrote:
    > > Where is a good place to write temporary files for evaluation that
    > > will be deleted once the evaluation has been completed? Are there
    > > standard directories that enough permission for users on the server?
    > > For example, /tmp

    >
    > So, what are you looking for that you're not finding in /tmp?
    >
    > If it's the auto-deletion, common strategies include running a cron job
    > every so often that deletes files older than some time period. It is
    > perfectly possible to create and use an alternate temporary directory
    > for some specific purpose so that it doesn't interfere with the regular
    > use of /tmp. There is of course no standard for that.
    >
    > If you want to pin it down to ``once ${action} has been completed'',
    > then how is the system going to discern that? What if multiple
    > ${action}s run concurrently? You might end up sweeping temporaries
    > right from under a running task.
    >
    > Asking a more specific question enables more specific answers.
    >
    > --
    > * j p d (at) d s b (dot) t u d e l f t (dot) n l .
    > * This message was originally posted on Usenet in plain text.
    > * Any other representation, additions, or changes do not have my
    > * consent and may be a violation of international copyright law.


    What's not specific about my question? Can you read English?

  4. Re: Temporary Files

    On Thu, 2 Oct 2008 10:47:02 -0700 (PDT),
    John Doe wrote:
    [failure to trim quotes corrected]
    > On Oct 2, 11:05*am, jpd wrote:
    >> Asking a more specific question enables more specific answers.

    ^^^^
    The devil is in the details.


    > What's not specific about my question? Can you read English?


    Amazingly, I can, even though it's not my native language. I also know
    yet another googlegrouper in over his head when I see one. I wish you
    luck finding a different source of free advice elsewhere.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  5. Re: Temporary Files

    John Doe wrote:
    > Where is a good place to write temporary files for evaluation that
    > will be deleted once the evaluation has been completed? Are there
    > standard directories that enough permission for users on the server?
    > For example, /tmp


    In general, avoid temp files.
    For multiple evaluation of small data, a shell variable can store it
    (query it quoted: "$variable").

    /tmp can be used for medium size files.
    /var/tmp is either the same as /tmp, or can be used for large files.
    For simultenous invocation and security,
    have a file name with process ID: "filename.$$"


    --
    echo imhcea\.lophc.tcs.hmo |
    sed 's2\(....\)\(.\{5\}\)2\2\122;s1\(.\)\(.\)1\2\11g;1 s;\.;::;2'

  6. Re: Temporary Files

    On Thu, 02 Oct 2008 08:58:29 -0700, John Doe wrote:

    > Where is a good place to write temporary files for evaluation that will
    > be deleted once the evaluation has been completed? Are there standard
    > directories that enough permission for users on the server? For example,
    > /tmp


    The standard place for temporary files is /tmp

    But you suggested /tmp, so I wonder what it is you want to know.

    stonerish

  7. Re: Temporary Files

    In article <0gbFk.995$mh.258@newsfe29.ams2>,
    jellybean stonerfish wrote:

    > On Thu, 02 Oct 2008 08:58:29 -0700, John Doe wrote:
    >
    > > Where is a good place to write temporary files for evaluation that will
    > > be deleted once the evaluation has been completed? Are there standard
    > > directories that enough permission for users on the server? For example,
    > > /tmp

    >
    > The standard place for temporary files is /tmp
    >
    > But you suggested /tmp, so I wonder what it is you want to know.


    I wonder if it's related to his reference to "evaluation". One of the
    other responses seemed to think he means variable evaluation. I have a
    feeling he means evaluation copies of software, that you're allowed to
    run for 30 days and then it will delete itself.

    If he's wondering where to install this software tempoarily, /tmp is
    probably NOT a good place, since things get deleted there automatically
    under various circumstances (on many systems the entire directory is
    wiped during reboot). /var/tmp is probably safer (and usually bigger),
    but it's still usually intended for things that don't need to last more
    than a few days.

    I don't think there's a system-wide directory that really fits the needs
    for this. I'd probably install into a subdirectory of the user's home
    directory, or ask them for a location.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

  8. Re: Temporary Files

    On Thu, 02 Oct 2008 18:05:41 -0400, Barry Margolin wrote:

    > If he's wondering where to install this software tempoarily, /tmp is
    > probably NOT a good place, since things get deleted there automatically
    > under various circumstances (on many systems the entire directory is
    > wiped during reboot). /var/tmp is probably safer (and usually bigger),
    > but it's still usually intended for things that don't need to last more
    > than a few days.
    >
    > I don't think there's a system-wide directory that really fits the needs
    > for this. I'd probably install into a subdirectory of the user's home
    > directory, or ask them for a location.


    For software that is being evaluated, I believe /opt is the proper
    location. I interpret "being evaluated" as being "add-on application"s.
    Stuff that does not come with your system, but you want to install.

    From "Filesystem Hierchy Standard":
    /opt is reserved for the installation
    of add-on application software packages.

    http://www.pathname.com/fhs/


    stonerfish




  9. Re: Temporary Files

    On Thu, 02 Oct 2008 22:34:12 +0200
    Michael Tosch wrote:

    > /tmp can be used for medium size files.
    > /var/tmp is either the same as /tmp, or can be used for large files.
    > For simultenous invocation and security,
    > have a file name with process ID: "filename.$$"


    ....or for actual security, mkstemp(3) or mktemp(1). And mkdtemp(3) on
    the BSDs and Linux (possibly others).

    --
    Andrew Deason
    adeason2@uiuc.edu

  10. Re: Temporary Files

    In article ,
    jellybean stonerfish wrote:

    > On Thu, 02 Oct 2008 18:05:41 -0400, Barry Margolin wrote:
    >
    > > If he's wondering where to install this software tempoarily, /tmp is
    > > probably NOT a good place, since things get deleted there automatically
    > > under various circumstances (on many systems the entire directory is
    > > wiped during reboot). /var/tmp is probably safer (and usually bigger),
    > > but it's still usually intended for things that don't need to last more
    > > than a few days.
    > >
    > > I don't think there's a system-wide directory that really fits the needs
    > > for this. I'd probably install into a subdirectory of the user's home
    > > directory, or ask them for a location.

    >
    > For software that is being evaluated, I believe /opt is the proper
    > location. I interpret "being evaluated" as being "add-on application"s.
    > Stuff that does not come with your system, but you want to install.


    But he was also concerned about permissions, which I think means the
    software is not being installed by root. /opt is usually not
    world-writable.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

  11. Re: Temporary Files

    On Fri, 03 Oct 2008 18:04:31 -0400, Barry Margolin wrote:

    >> For software that is being evaluated, I believe /opt is the proper
    >> location. I interpret "being evaluated" as being "add-on
    >> application"s. Stuff that does not come with your system, but you want
    >> to install.

    >
    > But he was also concerned about permissions, which I think means the
    > software is not being installed by root. /opt is usually not
    > world-writable.


    We may never know what john doe wants to do. His original post was
    confusing, and when asked to clarify, his only response was
    "What's not specific about my question? Can you read English?"

    If he is talking about testing software, and he doesn't have root access,
    he should install it in his home directory. Maybe in ~/evaluate. That
    way it won't be cleared by a /tmp cleaner.

    stonerfish

+ Reply to Thread