LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-27-2010, 09:13 PM   #16
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 90

I would definitely use -atime.... If it has not been accessed 'x' days, I remove it.
 
Old 12-27-2010, 09:31 PM   #17
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196
Quote:
Originally Posted by spoovy View Post
Yeah you're right. I'm not sure the man page makes sense in that respect.

Shouldn't it be -atime rather than -mtime though? As the hidden files won't be modified by rc.local therefore won't be spared when your code cleans /tmp. But they will presumably be "accessed" by the rc.local script when it checks if they are present or not.

Or am I misunderstanding ?
AFAIK find resets atime on files and directories it accesses. -atime will, of course not work on file systems mounted with noatime which is commonly used for performance.

Cleaning /tmp from rc.local will also remove any quota data, along with anything created as a result of running all the other boot scripts.

If /tmp is not on the / file system then it cannot be cleaned at the rc.S position described in the OP; it must be cleaned later, ideally just before "# Enable swapping again. This is needed in case a swapfile is used"

Last edited by catkin; 12-27-2010 at 09:34 PM. Reason: quality improvement program (QIP)
 
Old 12-27-2010, 10:02 PM   #18
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: KaOS
Posts: 831

Original Poster
Rep: Reputation: 96
I realized that I'm being an idiot... of course it didn't work at that point. I have /tmp in a separate LVM partition. I'm gonna try placing it elsewhere and get back to you.
 
Old 12-28-2010, 03:23 AM   #19
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 90
Quote:
Originally Posted by catkin View Post
AFAIK find resets atime on files and directories it accesses.
no, it wont...
You can do a simple check with "ls -l --time=atime"

Quote:
Originally Posted by catkin View Post
-atime will, of course not work on file systems mounted with noatime which is commonly used for performance.
Not sure if it's really so common. I only use 'noatime' on memory sticks etc. (if they're not FAT).
 
Old 12-28-2010, 04:23 AM   #20
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
I put the following entry in 'fstab' so that all contents are deleted after each shutdown:

Code:
tmpfs            /tmp             tmpfs       defaults         0   0
I've never encountered any problems with this approach.

Bill.
 
Old 12-28-2010, 05:37 AM   #21
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196
Quote:
Originally Posted by niels.horn View Post
no, it wont...
You can do a simple check with "ls -l --time=atime"
Thanks for the correction I would have tested if all my file systems were not mounted with noatime. Given that atime is not restored by find, atime is even less use than I thought it was! AFAIK tar and cpio do restore atimes ... ?
 
Old 12-28-2010, 05:44 AM   #22
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,035
Blog Entries: 16

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
Can't speak for tar, but with cpio you have to specify the "-a" option to preserve the access time.

edit:

At least that's according to the info page, however, from a quick test, specifying -a on a cpio -o causes the ctime to change, and not specifying -a doesn't seem to affect the atime, so the info page may be wrong on that one.

Last edited by GazL; 12-28-2010 at 05:53 AM.
 
1 members found this post helpful.
Old 12-28-2010, 08:16 AM   #23
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
Just for the heck of it:
Code:
fubar-trona-/home/trona: mkdir stuff
fubar-trona-/home/trona: stat stuff
  File: `stuff'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 807h/2055d      Inode: 130942      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/   trona)   Gid: (  100/   users)
Access: 2010-12-28 08:41:32.447262540 -0500
Modify: 2010-12-28 08:41:32.447262540 -0500
Change: 2010-12-28 08:41:32.447262540 -0500
That is, make a directory, atime, mtime and ctime are all the same.
Code:
fubar-trona-/home/trona: find stuff -print
stuff
fubar-trona-/home/trona: stat stuff
  File: `stuff'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 807h/2055d      Inode: 130942      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/   trona)   Gid: (  100/   users)
Access: 2010-12-28 08:41:56.710261990 -0500
Modify: 2010-12-28 08:41:32.447262540 -0500
Change: 2010-12-28 08:41:32.447262540 -0500
Execute find on the directory, atime changes, mtime and ctime do not.
Code:
fubar-trona-/home/trona: print "Hello, world" > stuff/junk
fubar-trona-/home/trona: stat stuff
  File: `stuff'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 807h/2055d      Inode: 130942      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/   trona)   Gid: (  100/   users)
Access: 2010-12-28 08:41:56.710261990 -0500
Modify: 2010-12-28 08:42:21.007262534 -0500
Change: 2010-12-28 08:42:21.007262534 -0500
That is, create a file in a directory, directory atime changes, mtime and ctime do not.
Code:
fubar-trona-/home/trona: find stuff -print
stuff
stuff/junk
fubar-trona-/home/trona: stat stuff
  File: `stuff'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 807h/2055d      Inode: 130942      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/   trona)   Gid: (  100/   users)
Access: 2010-12-28 08:42:32.098263399 -0500
Modify: 2010-12-28 08:42:21.007262534 -0500
Change: 2010-12-28 08:42:21.007262534 -0500
This is, execute find, directory atime changes, mtime and ctime do not.
Code:
fubar-trona-/home/trona: stat stuff/junk
  File: `stuff/junk'
  Size: 13              Blocks: 8          IO Block: 4096   regular file
Device: 807h/2055d      Inode: 130943      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   trona)   Gid: (  100/   users)
Access: 2010-12-28 08:42:21.007262534 -0500
Modify: 2010-12-28 08:42:21.007262534 -0500
Change: 2010-12-28 08:42:21.007262534 -0500
That is, execute find on file in directory, file atime, mtime and time do not change.

All that being as it is, I really like Toods approach -- blow the entire thing away at shutdown. Methinks that's what I'm going to do and forget about all this other stuff.

Hope this helps some.

Last edited by tronayne; 12-28-2010 at 08:17 AM.
 
1 members found this post helpful.
Old 12-28-2010, 08:32 AM   #24
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,035
Blog Entries: 16

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
Yep, the tmpfs approach is a good way to do this and I've used it in the past. You can always use /var/tmp for stuff that won't fit in memory should you need to.

In fact, a lot of the stuff that people do in /tmp probably belongs in /var/tmp anyway.
 
Old 01-09-2011, 11:45 AM   #25
vivanguarda
Member
 
Registered: Sep 2008
Location: RJ-Brazil
Distribution: Slackware
Posts: 181

Rep: Reputation: 5
In spite of having solved in this topic I 'd like to deep knowledge about possible problems deleting /tmp , /sys/tmp/, cached and log rotations arquives .


I use slackware 13.1 exploring root and another user called: “normal”. Right after a fresh install there are inside /temp : kde-normal/, kde-root/, ksocket-normal/ ksocket-root/, kde-socket. Is safe to delete it? And what should I do to delete log arquives?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
TRAC - something is clearing /tmp Lantzvillian Linux - Software 1 03-06-2010 08:49 AM
Can't login, says tmp directory full but tmp file is empty! Could be linked to MySQL? bethanlowder Fedora 7 09-25-2009 07:17 AM
how to securing /tmp , /var/tmp and /dev/shm hackintosh Linux - Security 7 10-17-2007 11:26 PM
[SOLVED] clearing /tmp at reboot sylye Debian 2 08-26-2006 04:42 AM

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

All times are GMT -5. The time now is 02:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration