--
Phil Ngai (408) 988-7777 {ucbvax,decwrl,ihnp4,allegra,intelca}!amd70!phil
Erik E. Fair
dual!fa...@Berkeley.ARPA
{ihnp4,ucbvax,cbosgd,decwrl,amd70,fortune,zehntel}!dual!fair
Dual Systems Corporation, Berkeley, California
Dave Sherman
Toronto
--
{allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave
It's hard to give even a ballpark guide to how big a file can get before it
should be put in /usr/tmp rather than /tmp, but I'll submit (at the risk of
getting flamed mercilessly) that if it's under 10Kb, /tmp is fine; if it's
over a couple hundred Kb it better be in /usr/tmp. The consequences of
running out of space in /tmp are sufficiently unpleasant not to betaken
lightly.
If you have only one chunk of disk for temporary storage, try to arrange so
that you still have both /tmp and /usr/tmp, to avoid breaking programs you
may receive. (This can be messy - if you don't have symbolic links, it
means that /tmp and /usr/tmp have to be in the same filesystem, which
leaves you with all of /usr in /.)
--
{hao,ucbvax,allegra}!nbires!rcd
At one time (circa the time of the original Unix paper in CACM), the
Research machine was a 45 with a fixed-head disk, some RK05s, and an RP03.
The root went on the fixed-head disk, since the absence of seek times
made it fast. But fixed-head disks (anybody remember them?) were *tiny*.
Two megabytes [sic] was a big fixed-head disk. So you had to be fairly
careful to avoid overflowing the root file system (which included /tmp --
it wasn't a separate filesystem). /usr, on the other hand, was the main
filesystem on the 40-MB RP03.
So you had a very sharp split of hardware: things directly under "/",
like /tmp, /bin, and /lib, were fast but had to be small; things under
/usr could be big but accesses to them were slower. So you put the
heavily-used commands in /bin, the heavily-used libraries in /lib, and
[flourish of trumpets] the small temporary files in /tmp. All the other
slush went under /usr, including a /usr/tmp directory for big temporaries.
This is why a few programs like sort(1) put their temporaries in /usr/tmp:
they expect them to be big.
In practice, fixed-head disks are historical relics now, and much of the
justification for the various /x-/usr/x splits has disappeared. There is
one reason why you might retain a /tmp-/usr/tmp split, however. If your
/tmp filesystem is kept in "RAM disk" or something similar for speed,
you might want to keep your editor tempfiles somewhere else if your editor
has crash recovery. Crash recovery definitely works better when the files
it is looking for are kept in non-volatile memory!
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henry
The mv command can avoid copying a file if the target location is on the same
device. This way the window of vulnerability to system crashes could be made
much smaller for programs that need an "atomic" file update (i.e. you want
either the old version or the new version of a file, but not part of each or
neither, so you can restart after a crash by rerunning the updating program).
The schema is:
Do a bunch of stuff to create the new version of the file
in /usr/tmp/new$USER and take your time.
...
mv /usr/tmp/new$USER file
Unfortunately many systems are too big to put all the users' files on the same
device, so some users are in /a, some in /b, ..., but no one decided to put in
/a/tmp, /b/tmp, ... directories. You can still do the mv trick by making the
newversion file in the same directory as the old file, but if the system (or
the updating program) crashes in the middle of the update you have this ugly
garbage file left over.
UNIX users must always put exactly what they want in the file the first time :-)
Paul Scherf, Tektronix, Wilsonville, Oregon, USA
pau...@tekecs.UUCP
However, specific scripts and programs that we need to utilize while
in single-user use /tmp since /usr is usually not mounted. This is
why such guys as ed(1), cc(1),..... use /tmp. If they used /usr/tmp,
you would be restricted in what you can do in single-user.
Since we have gone to RP07's for our 780's, space on / is not tight
anymore. But, in general, we still use /usr/tmp as a practice.