Link two directories

Link two directories

am 14.04.2008 12:07:20 von Mike

Hi,

I am running out of space on my /tmp directory. But my /local/scratch
is almost empty.
How can I link my /tmp to store on /local/scratch instead?

cheers,

//mike

Re: Link two directories

am 14.04.2008 12:21:12 von fazlin

On Apr 14, 3:07=A0pm, mike wrote:
> Hi,
>
> I am running out of space on my /tmp directory. But my /local/scratch
> is almost empty.
> How can I link my /tmp to store on /local/scratch instead?
>
> cheers,
>
> //mike

Create a link to /loca/scratch from /tmp as shown:

# ln -s /local/scratch /tmp/scratch

Now all the contents that you put in /tmp/scratch will land in /local/
scratch.

- Fazlin

Re: Link two directories

am 14.04.2008 13:08:00 von mallin.shetland

mike scrisse:
> I am running out of space on my /tmp directory.

# rm -fr /tmp/*

**BEWARE** you are root!

It is nice doing this in single user mode or in init scripta.


> ...
> How can I link my /tmp to store on /local/scratch instead?

Wrong way!

The right way is clean up /tmp on boot or on shutdown so
you have a clean system oat starup.

That if you have a simple desktop, for a server that you
never shutdown you can contemplate adding a cron job that
periodically clean up /tmp directory.

Re: Link two directories

am 14.04.2008 15:07:58 von Maxwell Lol

mike writes:

> How can I link my /tmp to store on /local/scratch instead?


Some applications will use another directory instead of /tmp. It
might be a command line option, or by setting the TMPDIR environment
variable.

Re: Link two directories

am 14.04.2008 17:49:19 von johngnub

2 more cents, do not forget to look fot "dot" files, stuff
like .X11*, try a `ls -la` or
my fav, `find /tmp -ls `, they may be the cause of your space issues.,

JB

mallin.shetland wrote:
> mike scrisse:
> > I am running out of space on my /tmp directory.
>
> # rm -fr /tmp/*
>
> **BEWARE** you are root!
>
> It is nice doing this in single user mode or in init scripta.
>
>
> > ...
> > How can I link my /tmp to store on /local/scratch instead?
>
> Wrong way!
>
> The right way is clean up /tmp on boot or on shutdown so
> you have a clean system oat starup.
>
> That if you have a simple desktop, for a server that you
> never shutdown you can contemplate adding a cron job that
> periodically clean up /tmp directory.