| Author |
Message |
linuxer *nix forums beginner
Joined: 11 Feb 2005
Posts: 8
|
Posted: Mon Feb 28, 2005 2:33 pm Post subject:
clean /tmp
|
|
|
does anyone knows how can I remove some files on my /tmp directory ?
the dierctory is full and php sessions do not work anymore . |
|
| Back to top |
|
 |
linuxgeek *nix forums beginner
Joined: 04 Feb 2005
Posts: 1
|
Posted: Mon Feb 28, 2005 2:56 pm Post subject:
re:clean /tmp
|
|
|
you should just delete the files that are older than 6 hours or whatever you think would be safe.
To do this you could use this:
find -amin +360 -exec rm {}
you could also set up a crontab entry with this. |
|
| Back to top |
|
 |
linuxer *nix forums beginner
Joined: 11 Feb 2005
Posts: 8
|
Posted: Mon Feb 28, 2005 3:05 pm Post subject:
re:clean /tmp
|
|
|
| linuxgeek wrote: |
find -amin +360 -exec rm {}
|
This does not work I get error:
find: missing argument to `-exec'
| Quote: |
you could also set up a crontab entry with this. |
how do I do this ? |
|
| Back to top |
|
 |
thelinux *nix forums beginner
Joined: 17 Feb 2005
Posts: 2
|
Posted: Mon Feb 28, 2005 3:09 pm Post subject:
re:clean /tmp
|
|
|
I think linuxgeek forgot to mention you have to end the rm command with a semicolon like this :
| Code: | | find -amin +360 -exec rm {} ';' |
|
|
| Back to top |
|
 |
linuxer *nix forums beginner
Joined: 11 Feb 2005
Posts: 8
|
Posted: Mon Feb 28, 2005 3:11 pm Post subject:
re:clean /tmp
|
|
|
thank's ... it worked this time.
Can you also tell me how to could I make this run automatically, like to schedule it somehow ? |
|
| Back to top |
|
 |
mihai *nix forums addict
Joined: 27 Jan 2005
Posts: 71
|
Posted: Mon Feb 28, 2005 3:15 pm Post subject:
re:clean /tmp
|
|
|
yeah just put this line into your crontab:
| Code: |
0 * * * * find -amin +360 -exec rm {} ';'
|
this will run that command every hour. |
|
| Back to top |
|
 |
linuxer *nix forums beginner
Joined: 11 Feb 2005
Posts: 8
|
Posted: Mon Feb 28, 2005 3:17 pm Post subject:
re:clean /tmp
|
|
|
|
how do I find my crontab ? |
|
| Back to top |
|
 |
thelinux *nix forums beginner
Joined: 17 Feb 2005
Posts: 2
|
Posted: Mon Feb 28, 2005 3:19 pm Post subject:
re:clean /tmp
|
|
|
just login as root and type :
crontab -e
and then add that line at the end of the file save the file and exit |
|
| Back to top |
|
 |
linuxer *nix forums beginner
Joined: 11 Feb 2005
Posts: 8
|
Posted: Tue Mar 01, 2005 7:15 am Post subject:
re:clean /tmp
|
|
|
ok I typed crontab -e and I'm now into some kind of editor and I don't know how to use it. It does not let me write something into it.
please help....
thanx |
|
| Back to top |
|
 |
linuxguru *nix forums beginner
Joined: 26 Feb 2005
Posts: 5
|
Posted: Tue Mar 01, 2005 7:26 am Post subject:
re:clean /tmp
|
|
|
you're probably into vi or vim
just type "i" and you'll go into "insert mode"
then write that line there and press "ESC" and then type ":wq" and you're out
take a look at vimtutor(1)
for more info about vim. |
|
| Back to top |
|
 |
linuxer *nix forums beginner
Joined: 11 Feb 2005
Posts: 8
|
Posted: Tue Mar 01, 2005 8:50 am Post subject:
re:clean /tmp
|
|
|
that worked
thanks |
|
| Back to top |
|
 |
KerneL *nix forums beginner
Joined: 28 Jan 2005
Posts: 37
|
Posted: Tue Mar 01, 2005 6:24 pm Post subject:
re:clean /tmp
|
|
|
Nice lessons do you have here guys  |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|