I suppose we should get the change into the qtp scripts. I'll take care of that. There's a new QTP coming out very soon.

Phil Leinhauser wrote:
Mtime wins!  I just ran mtime outputted to text file and it caught
everything I needed and nothing I didn't.  I then held my breath and let it
rip.  My it found almost 9000 messages including my 3000+ user was reduced
to less than 200.

Success!!

Thanks guys for the help!!

Phil

-----Original Message-----
From: Phil Leinhauser [mailto:[email protected]] Sent: Thursday, September 10, 2009 5:02 PM
To: [email protected]
Subject: RE: [qmailtoaster] qtprune



-----Original Message-----
From: [email protected] [mailto:[email protected]] Sent: Thursday, September 10, 2009 4:46 PM
To: [email protected]
Subject: Re: [qmailtoaster] qtprune

Phil Leinhauser wrote:
Phil Leinhauser wrote:
Phil Leinhauser wrote:
Phil Leinhauser wrote:
Thanks for the info Dave. I did just what you described except I
pushed
it to a text file so I could see better what was happening.

I ran it with the 5 day setting and didn't get anything. Then I
dropped
it to 2 days and got a list. The script is apparently working but
only
on about half of the domains. I have other domains that never
made
it
into the output.txt file. I know there is trash there because I
have
one user with over 3000 messages.

I guess now the question is, does the script just delete
everything
older than DELTIME? or is it looking for something to only get
messages? I see in the output that it looks like it's going to
delete
some index and dovecot-uidlist files. Is this ok?
It probably shouldn't delete these files, but I don't think it
will
hurt
anything. Dovecot is very robust and will fix things on the fly
that
get
wacked out. If you give me the exact file names I can add an
exception
to the script.

What can I do to see
why it's not finding all of the old messages?.
Do you have this statement in your script?:
for each in "${PATH_TRASH}" ; do
Try removing the quotes and see if that fixes it.

The qtp-clean-spam script had the same bug that was fixed last
December.
Looks like I missed fixing the qtp-clean-trash script.

Eric,
I removed the quotes and reran with the same results, still not
finding
all messages.

Here are the control files names:
courierimapacl
courierimapuiddb
dovecot.index.cache
dovecot.index.log
dovecot-uidlist
maildirfolder
All of these are in .Trash and all other folders (.Drafts, .etc) so
a
global exclude might be in order. You'll know better what can be
deleted and what can stay. Since I'm now on dovecot I'm sure the
courier files can go but it might be good to exclude the entire list
for
those who are still on courier.
Thanks Phil. Can you try replacing
for each in "${PATH_TRASH}" ; do
FILES_TO_DELETE="`find ${each} -type f -ctime +$DELTIME`"
if [ -n "${FILES_TO_DELETE}" ]; then
for file in ${FILES_TO_DELETE} ; do
if [ -n ${file} ]; then
rm -f ${file} >/dev/null 2>&1
fi
done
fi
done
with
for each in $PATH_TRASH; do
find $each -type -f -ctime +$DELTIME -exec rm -f {} \;
done

The find command is quite powerful indeed. ;)
So now it looks like this:
if [ -n "${PATH_TRASH}" ]; then
for each in $PATH_TRASH; do
find $each -type -f -ctime +$DELTIME -exec rm -f {} \;
done
fi

But I get an error: find: invalid argument `-f' to `-type'
Sorry. It's just "-type f"
OK, it ran but I still have 3000+ messages.  Would it break anything
to swap to mtime?
Phil,
I doubt  your backup utility would change the ctime on these files.
Generally speaking, backup utilities use ctime to determine if the file
should be backed up or not when doing master, differential, incremental
backups. Something else is changing the ctime. see this link for a good
description of the difference between atime, ctime, mtime. I personally
wouldn't be afraid of using mtime instead of ctime if it deletes the files.

http://www.unix.com/tips-tutorials/20526-mtime-ctime-atime.html

I think the issue with the 3000+ messages is the shell. Maybe need to use
find $each -type -f -ctime +$DELTIME -print | xargs /bin/rm -f

Dave

Thanks for the help here Dave and Eric.

I may not have been too clear in the beginning.  The 3000+ message account
is the one I'm using as a gauge to check operation.  I have several others
that are in the same boat, just not an obvious number of messages.  The 3000
is easy to see if there's a dent in the count after running.

I'll try the mtime and see what happens.  I'll run the DELTIME out to 30 to
be sure I don't nix something wrong.




--
-Eric 'shubes'


---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)
   Vickers Consulting Group offers Qmailtoaster support and installations.
     If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
    Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]


Reply via email to