I was wondering why mtime only returned one page... I missed the --more--. mtime does seem to work correctly to find the messages.
Why is there a preference to ctime over mtime? I just did a bit of reading and it seems mtime only changes when the file changes but ctime might change with ACL changes or even flag changes? I'm thinking to myself... Hmmm Archive bit... I'm using backup exec to backup this server. Changing the archive bit or grab it for backup might change the ctime??? > Phil, > The way I read the script is that it only deletes files older than > DELTIME and only files in the .Trash directories as well as any files in > directories below .Trash. Are you getting any errors in the output > file? Like "argument list too long"? > > As for the user that has 3000 messages. Are you saying the user has 3000 > messages in .Trash directory? Whichever, you could cd to that users > .Trash directory and run this from the command line. > # find . * -ctime +5 -exec ls -al {} \; | more > this will list any files with a ctime older than 5 days. > > I do not use dovecot so I cannot comment on deleting index and > dovecot-uidlist files. Interesting though. Are the index and > dovecot-uidlist files in .Trash or are they in a directory below .Trash? > I only ask that because the find command can be instructed not to go > that deep into the .Trash directory. > I doubt that dove-cot changes the ctime on these files, but someone > familiar with dove-cot would have to answer that. ctime and mtime are > confusing. Depending on the actions taken on a file one or both times > may or may not change. > > Dave > > > > 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? What can I do to >> see why it's not finding all of the old messages?. >> >> >> >> >> > Hi Phil, >> > The line you are looking at >> > PATH_TRASH="`find /home/vpopmail/domains -type d -name .Trash`" is not >> > the problem. By default "find" will start looking in the path for >> > files/directories and is recursive. So it is starting in >> > /home/vpopmail/domains looking for any directories (-type d) named >> > .Trash. So it will find any .Trash directories living under >> > /home/vpopmail/domains. >> > >> > Looking at /opt/qmailtoaster-plus/etc/cron.hourly/qtp-clean-trash the >> > real processing is done in the nested if statements. The script is >> > written so that all output of the rm command is sent to /dev/null. So >> > you will never see what it is doing. >> > >> > Just to test the script, I copied it to a new file called "myscript" >> and >> > changed the following. Look for this line: >> > rm -f ${file} >/dev/null 2>&1 >> > change it to this >> > ls ${file} >> > >> > then run myscript (make sure the script is executable) >> > >> > it should list all the files it would delete if the original script >> was >> > run. >> > >> > If it returns nothing, then you have no files older than the default 5 >> > days in any .Trash directory under /home/vpopmail/domains. I think I >> > would then change the line >> > DELTIME=5 >> > to >> > DELTIME=1 >> > in myscript and try it again. >> > >> > Post back if it listed any files. >> > >> > Dave >> > >> > >> > >> > Eric Shubert wrote: >> >> That might be as a result of not having everything under INBOX with >> >> dovecot. I'll try to have a look at it tomorrow. >> >> >> >> Phil Leinhauser wrote: >> >>> OK, I found the qtp-clean-trash script and ran that. Qtprune is the >> >>> grandfather but basically the same. They are both looking in .Trash >> >>> for the >> >>> old messages. My system has them in .Trash/cur. It's not finding >> >>> the old >> >>> ones. It only runs for a second or 2. I expect it to run a few >> >>> minutes at >> >>> least. I have a bunch of trash! >> >>> >> >>> -----Original Message----- >> >>> >> From: Jake Vickers [mailto:j...@qmailtoaster.com] Sent: Wednesday, >> >>> September 09, 2009 8:39 PM >> >>> To: qmailtoaster-list@qmailtoaster.com >> >>> Subject: Re: [qmailtoaster] qtprune >> >>> >> >>> Phil Leinhauser wrote: >> >>>> I just decided to start running qtprune. It's the first time I've >> >>>> run it. >> >>>> I'll cron it once I'm happy with the results. What I see in the >> >>>> script is >> >>>> that it seems to be looking in the .Trash folder. The problem is >> >>>> that the >> >>>> trashed messages are actually in the .Trash/cur folder. Therefore, >> >>> qtprune >> >>>> doesn't find them. In fact, all of my folders are in the >> >>>> .something/cur >> >>>> folder. >> >>>> 2 questions: >> >>>> 1- Is this because of dovecot? I don't ever remember the folder >> >>>> structure >> >>>> before dovecot. >> >>>> 2- How can I change the script to get them? PATH_TRASH="`find >> >>>> /home/vpopmail/domains -type d -name .Trash`" is the >> >>> line >> >>>> in the script and I tried to change it to .Trash/cur but I got an >> >>>> error: >> >>>> >> >>>> find: warning: Unix filenames usually don't contain slashes (though >> >>>> pathnames do). That means that '-name .Trash/cur' will probably >> >>>> evaluate >> >>> to >> >>>> false all the time on this system. You might find the '-wholename' >> >>>> test >> >>>> more useful, or perhaps '-samefile'. Alternatively, if you are >> >>>> using GNU >> >>>> grep, you could use 'find ... -print0 | grep -FzZ .Trash/cur'. >> >>>> >> >>>> So, any ideas? I'm not a linux scripter... >> >>>> >> >>> >> >>> qtprune? Or the qtp-clean-trash script in Qmailtoaster-Plus? >> >>> The one in QTP works. I just tested it. >> >>> It can be installed by the qtp-menu and it runs as an hourly cron >> >>> job. It (by default) deletes messages older than 5 days, but this ca >> >>> be changed by changing the value in the >> >>> /etc/cron.hourly/qtp-clean-trash script (or by creating a file >> called >> >>> /var/qmail/control/deltrash and putting the number of days in the >> >>> file). >> >>> >> >>> >> >> >> >> >> > >> > >> --------------------------------------------------------------------------------- >> > 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: >> > qmailtoaster-list-unsubscr...@qmailtoaster.com >> > For additional commands, e-mail: >> > qmailtoaster-list-h...@qmailtoaster.com >> > >> > >> > > > --------------------------------------------------------------------------------- > 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: > qmailtoaster-list-unsubscr...@qmailtoaster.com > For additional commands, e-mail: > qmailtoaster-list-h...@qmailtoaster.com > > >