Prunning old session files ?

Support for webhosts that use CentOS
Post Reply
Silent_Ninja
Posts: 4
Joined: 2008/01/07 16:04:15
Contact:

Prunning old session files ?

Post by Silent_Ninja » 2008/09/09 18:32:03

I've heard that is possible with tmpwatch to prune old sess files from the tmp folder, but I wasn't able to get the line that deletes all sess_* files older than 24 hs (with the noatime mount option, I think something needs to be replaced at tmpwatch).

User avatar
AlanBartlett
Forum Moderator
Posts: 9324
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Prunning old session files ?

Post by AlanBartlett » 2008/09/10 14:13:09

Please check:

[b]man 8 tmpwatch[/b]

Silent_Ninja
Posts: 4
Joined: 2008/01/07 16:04:15
Contact:

Re: Prunning old session files ?

Post by Silent_Ninja » 2008/09/10 14:47:22

[quote]
AlanJBartlett wrote:
Please check:
[b]man 8 tmpwatch[/b][/quote]

Really heplful... not.

Look, I have this:
[b]tmpwatch --ctime --force --nodirs --nosymlinks --quiet 24 /tmp[/b]


But it will delete everything unchanged on the last 24hs on the tmp folder except for dirs and symlinks.. I want to delete ONYL the sess_* files.
Is it possible to do that ?


Also I want to check the CREATION time, but tmpwatch makes the desitions based on change / modification / access time, not creation..
Will it work anyway ?

User avatar
AlanBartlett
Forum Moderator
Posts: 9324
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Prunning old session files ?

Post by AlanBartlett » 2008/09/10 16:02:05

[quote]
Really heplful... not.
[/quote]
Please try again and you will see the following:

[code]
[b]DESCRIPTION[/b]
tmpwatch recursively removes files which haven’t been accessed for a given number of hours. Normally, it’s used to clean up directo-
ries which are used for temporary holding space such as /tmp.
[/code]
Note the second sentence.

[quote]I've heard that is possible with tmpwatch to prune old sess files from the tmp folder[/quote]
Perhaps you should go back and ask the person from whom you heard the above assertion.

Post Reply

Return to “CentOS 5 - Webhosting Support”