niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux
clean /tmp
Post new topic   Reply to topic Page 1 of 1 [12 Posts] View previous topic :: View next topic
Author Message
linuxer
*nix forums beginner


Joined: 11 Feb 2005
Posts: 8

PostPosted: Mon Feb 28, 2005 2:33 pm    Post subject: clean /tmp Reply with quote

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

PostPosted: Mon Feb 28, 2005 2:56 pm    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Mon Feb 28, 2005 3:05 pm    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Mon Feb 28, 2005 3:09 pm    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Mon Feb 28, 2005 3:11 pm    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Mon Feb 28, 2005 3:15 pm    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Mon Feb 28, 2005 3:17 pm    Post subject: re:clean /tmp Reply with quote

how do I find my crontab ?
Back to top
thelinux
*nix forums beginner


Joined: 17 Feb 2005
Posts: 2

PostPosted: Mon Feb 28, 2005 3:19 pm    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Tue Mar 01, 2005 7:15 am    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Tue Mar 01, 2005 7:26 am    Post subject: re:clean /tmp Reply with quote

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

PostPosted: Tue Mar 01, 2005 8:50 am    Post subject: re:clean /tmp Reply with quote

that worked
thanks
Back to top
KerneL
*nix forums beginner


Joined: 28 Jan 2005
Posts: 37

PostPosted: Tue Mar 01, 2005 6:24 pm    Post subject: re:clean /tmp Reply with quote

Nice lessons do you have here guys Smile
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [12 Posts] View previous topic :: View next topic
The time now is Tue Dec 02, 2008 6:35 pm | All times are GMT
navigation Forum index » *nix » Linux
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Sound Configuration problem on clean Sarge install Richard Cookson Debian 0 Fri Jul 21, 2006 2:30 pm
No new posts clean up old log files adrian.alek@gmail.com IBM DB2 2 Wed Jul 05, 2006 4:03 pm
No new posts A clean way to introduce delay between scripts in /etc/in... LEE, Yui-wah (Clement) devel 7 Mon Jun 12, 2006 7:50 pm
No new posts force clean database shutdown maxim2k Server 8 Thu Jun 08, 2006 3:16 pm
No new posts DHCP not working on clean install? Henrik Goldman HP-UX 7 Thu Jun 01, 2006 7:37 pm

Mortgage Calculator | Loan | Personal Loans | Advertising | Credit Card
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1346s ][ Queries: 16 (0.0531s) ][ GZIP on - Debug on ]