LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-27-2013, 04:47 AM   #31
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018

Quote:
Originally Posted by guanx View Post
Abuse? Criminal offense? Seriously!
We were talking about /tmp usage comparable to the main memory size. As the main memory size is usually 0.1~1% of the disk size, so you mean filling up 0.1~1% of the disk space is just a sign of abuse?
The only one who has mentioned "Criminal offense" is yourself.
abuse (verb): to use wrongly or improperly. My use of the word was correct.

Last edited by GazL; 07-27-2013 at 05:51 AM.
 
1 members found this post helpful.
Old 07-27-2013, 08:54 AM   #32
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,445
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by guanx
Even /usr/src is a better place to compile software than /root because it's bad practice to mount /root on a separate filesystem but it's the contrary for /usr/src.
ok. you have officially lost me. I'm out.
 
Old 07-27-2013, 11:29 AM   #33
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
Quote:
Originally Posted by rng View Post
According to http://docs.slackware.com/howtos:gen...ree_your_space, following command should be put in /etc/rc.d/rc.local_shutdown :
Code:
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -print0 | xargs -0r /bin/rm -rf
This seems to work. Beware of glob and bash loops: you have to be super-duper sure it treats filenames with spaces, tabs, and new lines right. Would this be OK, I wonder?

Code:
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -delete
Nevermind: non-empty folders get skipped.

Last edited by qweasd; 07-27-2013 at 12:22 PM.
 
Old 07-27-2013, 02:50 PM   #34
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Rep: Reputation: 242Reputation: 242Reputation: 242
I have a 250GB hard drive:
20GB /root
1GB swap
1.5GB tmpfs (default)
remaining GB /home

Sometimes I remove /tmp/SBo/ but everything else in it remains. Gives me a quick view of the extra stuff I have installed. That and my /home/Slackbuilds directory. Doesn't get in my way a bit.
 
Old 07-27-2013, 10:15 PM   #35
irgunII
Member
 
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383

Rep: Reputation: 72
Quote:
Originally Posted by rkelsen View Post
(about my question regarding deleting SBo in /tmp)
Absolutely. In fact, I would recommend it. Files generated by sbopkg take a ton of space in /tmp. And none of them are used after it installs the packages it built.
Thanks, done and everything's working normally still and I gained 13GB, heh.
 
Old 07-28-2013, 07:10 AM   #36
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by irgunII View Post
Thanks, done and everything's working normally still and I gained 13GB, heh.
Similar here. Disk usage gone down from 67% to 51%.
 
Old 07-29-2013, 01:04 PM   #37
rkfb
Member
 
Registered: Oct 2003
Location: Guildford, England
Distribution: Slackware64 15.0 running i3
Posts: 494

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by vdemuth View Post
I use the following in rc.6


# clean tmp of old and stale files
echo "Cleaning temporary files"
find /tmp -type f -mtime +5 -exec rm -f {} \;
find /var/tmp -type f -mtime +30 -exec rm -f {} \;


Can't remember where it came from but works well and keeps /tmp relatively small
Maybe better in rc.local_shutdown which is called by rc.6
 
Old 08-01-2013, 08:43 AM   #38
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by rg3 View Post
Not really. Let's say I populate a directory with two files named "foo" and "bar\nbaz", that is, "bar<newline>baz", and I have a script with the following contents:

Code:
#!/bin/sh
for f in `ls`; do echo rm -fr "$f"; done
Running the script yields:

Code:
rm -fr bar
rm -fr baz
rm -fr foo
I'm not making things up. I just tested this.
You are convincing me that quotes doesn't work always but how did you create that file with new line in the name?
I tried touch foo\nbar , touch foo\\nbar , touch "foo\\nbar" , touch "foo\nbar" , without success.


I was looking at the ls options again, and there is this option "-Q" (and --quoting-style=WORD) that I think is very
usefull, it encloses the names with spaces in double (or single) quotes.


Sorry if this is a little bit off-topic.
 
Old 08-01-2013, 10:37 AM   #39
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
Quote:
Originally Posted by Paulo2 View Post
You are convincing me that quotes doesn't work always but how did you create that file with new line in the name?
Code:
touch $'foo\nbar'
 
Old 08-01-2013, 11:26 AM   #40
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by qweasd View Post
Code:
touch $'foo\nbar'
didn't work
Code:
paulo@paulo:~/Isos$ touch $'foo\nbar'
paulo@paulo:~/Isos$ v
total 0
-rw-r--r-- 1 paulo users 0 Ago  1 13:04 foo\nbar
paulo@paulo:~/Isos$ for i in `ls`;do echo rm -rf "$i";done
rm -rf foo\nbar
paulo@paulo:~/Isos$ for i in `ls`;do echo rm -rf $i;done
rm -rf foo\nbar
But if I type directly with tab auto-completing, the "\n" appears like a real new line
Code:
paulo@paulo:~/Isos$ rm 'foo
bar'
Well, now I know that there are characters that quotes doesn't handle, I will be more careful.
 
Old 08-01-2013, 05:53 PM   #41
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by GazL View Post
... though anything that is going to use a large amount of disk space like that really should be assigned it's own dedicated space so as not to impact the rest of the system and/or its users)
You forgot the I/O bandwidth, CPU power to deal with these data, etc. "Not to impact the rest of the system" is simply impossible.

Quote:
Originally Posted by GazL View Post
but it's more common that a large amount of data collecting in /tmp is just a sign of abuse of the filesystem.
I repeat my last post: Filling the filesystem by 0.1% is far from abuse. Storage is there to be filled, money is there to be spent, life is there to be lived. If anyone don't agree, don't live.

Quote:
Originally Posted by GazL View Post
If the programs using /tmp have been correctly written, then in theory you should be able to remove the files in /tmp at any time - even while the programs are still running and it shouldn't cause a problem ...
Who told you this? I've never heard of this nonsense before.
 
Old 08-01-2013, 05:55 PM   #42
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,176

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by rkfb View Post
Maybe better in rc.local_shutdown which is called by rc.6
Yes that's better. And a mkfs on startup is the best, if /tmp is on a separate filesystem but not tmpfs.
 
Old 08-01-2013, 09:13 PM   #43
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
Paulo2, may be my bash-fu is lacking, but I don't see a way around it without find -print0, which is guaranteed to work at least on ext, since the latter forbids zero chars in file names. OTOH, parsing the output of /bin/ls seems like a rather nasty problem, because it separates file names with new lines, and file names may contain new lines, spaces, tabs, quotes, and what have you.
 
Old 08-02-2013, 06:00 AM   #44
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
Quote:
Originally Posted by Paulo2 View Post
but how did you create that file with new line in the name?
Normally by accident. :-)

For example, you can create them with:

Code:
touch 'foo
bar'
Or from a program in some programming language. In Python it's pretty simple:

Code:
python -c 'open("bar\nbaz", "w")'
And yeah, sorry for the off-topic...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Clearing /tmp at shutdown 2handband Slackware 8 11-09-2010 04:14 PM
Automatic clean shutdown on overheating wpost Linux - Hardware 7 05-28-2010 08:56 AM
clean-tmp - cron task suse 10.3 flebber SUSE / openSUSE 2 10-07-2007 01:02 AM
How to clean /tmp mkhan919 Linux - Newbie 7 03-05-2007 01:34 PM
automatically emptying /tmp at shutdown adityavpratap Slackware 13 01-31-2007 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration