Re: clearing out /tmp safely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom 'Needs A Hat' Mitchell wrote:
On Fri, Mar 26, 2004 at 11:47:55AM -0600, Robert wrote:

Tom Needs a Hat Mitchell wrote:

On Tue, Feb 17, 2004 at 12:49:31AM -0300, Alexandre Strube wrote:


Hello Matt



I would like to clean out my /tmp partition as per the tip at

....

Cleaning out /tmp /var/tmp by hand should be unnecessary beyond removing the
occasional big junk file.


See: /etc/cron.daily/tmpwatch



to verify that cron.daily was working. It was.
Then I tried executing (as root)

[root@mavis root]# /usr/sbin/tmpwatch 240 /tmp

and I *still* have a bunch of old files in /tmp

[root@mavis root]# find /tmp -ctime +10 | wc -l
   613


Are you finding files or directories.
I do see a list of empty dirs that make /tmp look untidy.
An "rmdir /tmp/* " cleans out only the empty ones.



There are both directories and files. Here's an example of files:

[root@mavis root]# ls -l /tmp | grep -v ^d | grep track
-rw-rw-r--    1 root     root     296769536 Jan 26 19:06 track-01.img
-rw-rw-r--    1 root     root          521 Nov 14 11:10 track-01.inf
-rw-rw-r--    1 root     root     30604268 Nov 14 11:10 track-01.wav
-rw-rw-r--    1 root     root          292 Jan 26 19:06 track-01.xinf
-rw-rw-r--    1 root     root          504 Nov 14 11:10 track-02.inf
-rw-rw-r--    1 root     root     34017020 Nov 14 11:10 track-02.wav
-rw-rw-r--    1 root     root          319 Nov 15 12:25 track-02.xinf
-rw-rw-r--    1 root     root          511 Nov 14 11:10 track-03.inf
-rw-rw-r--    1 root     root     29741084 Nov 14 11:10 track-03.wav
-rw-rw-r--    1 root     root          326 Nov 15 12:25 track-03.xinf
-rw-rw-r--    1 root     root          502 Nov 14 11:10 track-04.inf
-rw-rw-r--    1 root     root     28468652 Nov 14 11:10 track-04.wav
-rw-rw-r--    1 root     root          317 Nov 15 12:25 track-04.xinf
-rw-rw-r--    1 root     root          493 Nov 14 11:10 track-05.inf
-rw-rw-r--    1 root     root     38377628 Nov 14 11:10 track-05.wav
-rw-rw-r--    1 root     root          308 Nov 15 12:25 track-05.xinf
-rw-rw-r--    1 root     root          501 Nov 14 11:10 track-06.inf
-rw-rw-r--    1 root     root     33325532 Nov 14 11:10 track-06.wav
-rw-rw-r--    1 root     root          316 Nov 15 12:25 track-06.xinf
-rw-rw-r--    1 root     root          501 Nov 14 11:10 track-07.inf
-rw-rw-r--    1 root     root     24950060 Nov 14 11:11 track-07.wav
-rw-rw-r--    1 root     root          316 Nov 15 12:25 track-07.xinf
-rw-rw-r--    1 root     root          511 Nov 14 11:10 track-08.inf
-rw-rw-r--    1 root     root     29400044 Nov 14 11:11 track-08.wav
-rw-rw-r--    1 root     root          326 Nov 15 12:25 track-08.xinf
-rw-rw-r--    1 root     root          503 Nov 14 11:10 track-09.inf
-rw-rw-r--    1 root     root     31368668 Nov 14 11:11 track-09.wav
-rw-rw-r--    1 root     root          317 Nov 15 12:25 track-09.xinf
-rw-rw-r--    1 root     root          506 Nov 14 11:10 track-10.inf
-rw-rw-r--    1 root     root     31796732 Nov 14 11:11 track-10.wav
-rw-rw-r--    1 root     root          320 Nov 15 12:25 track-10.xinf
-rw-rw-r--    1 root     root          504 Nov 14 11:10 track-11.inf
-rw-rw-r--    1 root     root     13834508 Nov 14 11:11 track-11.wav
-rw-rw-r--    1 root     root          318 Nov 15 12:25 track-11.xinf
-rw-rw-r--    1 root     root          512 Nov 14 11:10 track-12.inf
-rw-rw-r--    1 root     root     29364764 Nov 14 11:11 track-12.wav
-rw-rw-r--    1 root     root          326 Nov 15 12:25 track-12.xinf
-rw-rw-r--    1 root     root          297 Jan 26 19:06 track.toc
[root@mavis root]#

I'm gonna try something for tonight. I'll create a new file, chmod it to 666, touch it to have the same date as track-12.wav above and see if that bugger goes away overnight. Like this:

[root@mavis root]# echo "abcdefghijklmnopqrstetc" > /tmp/zzzA-test-file.txt
[root@mavis root]# touch /tmp/zzzA-test-file.txt --reference=/tmp/track-12.wav
[root@mavis root]# chmod 666 /tmp/zzzA*
[root@mavis root]# ls -l /tmp/zzzA*
-rw-rw-rw- 1 root root 24 Nov 14 11:11 /tmp/zzzA-test-file.txt
[root@mavis root]# touch /tmp/zzzA-test-file.txt --reference=/tmp/track-12.wav
[root@mavis root]#


Now.  I won't even look at the /tmp directory until tomorrow morning.

Y'know, sometimes this stuff is more fun to look back at than forward to!









[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux