What is removing files from /tmp?

Mikkel L. Ellertson mellertson at gmail.com
Sat May 5 13:51:28 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/05/2012 08:42 AM, Reindl Harald wrote:
>
>
> Am 05.05.2012 15:28, schrieb Ted Roche:
>> On Wed, May 2, 2012 at 11:40 PM, Ed Greshko
<Ed.Greshko at greshko.com> wrote:
>>> When someone on this list asks for help in modifying a behavior
to suit their
>>> needs/desires why are they often asked to justify their requests?
In this case, and
>>> in may others, I can't see that seeking/offering justification
will help in finding a
>>> solution.
>>>
>>
>> This is often referred to as the "XY Problem" where a questioner has
>> problem X, has determined to solve it with solution Y, and is asking
>> for help getting solution Y to do what it is they think it should do.
>> In fact, solution Y may not be be the optimal solution, and there may
>> be a well-known and reliable solution to problem X. So, asking "why do
>> you want to do this?" often leads to the real problem, and a better
>> solution.
>>
>> Ref: http://www.catb.org/~esr/faqs/smart-questions.html#id479492
>
> especially in this case
>
> why storing data in /tmp and search how to change behavior of the
> OS instead simply use another directory and accept that /tmp is
> NOT a place where you can expect your data are alive at any time
> later?
>
> mkdir /mytmp
> chmod 1777 /mytmp
>
> so, now you have a folder with the same permissions as /tmp
> everybody can store files there, only the owner have access
> to them and nothing of the OS is touching it
>
>
>
The way I do it is to create a tmp directory in each user's home
directory. (Add to /etc/skel) Then I have TMP set to this
directory.  (Add local.sh and local.csh in /etc/profile.d) This
works for programs that honor TMP and is easy to add to scripts.

if [ -z $TMP ]
    then
        temp_file=/tmp/dd.$$
else
    temp_file=$TMP/dd.$$
fi

Mikkel
- -- 
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAk+lMGAACgkQqbQrVW3JyMSm4ACcCW1LU/abdyD9enyIQCw9E958
zQIAniPci+6V1wcwuqqvfwKstsAsOvMC
=qgxs
-----END PGP SIGNATURE-----



More information about the users mailing list