how about this ??
change
/FILES_TO_DELETE="`find ${each} -type f -ctime +${TRASH_DAYS}`"/
with
FILES_TO_DELETE="`find ${each} -type f`"
it will list all files in that folder, dont care when they last changed
(you want to delete all file in .Trash right ?)
Sergio Minini {NETKEY} wrote:
please, any ideas on this one? Thanks!-----Original Message-----Hey there,I modified the qtprune script, trying to purge the Trash folder and making it run every sunday, and leaving the spam aside. After running several times, I still have the files in /var/qmail/vpopmail/domains/xxx.com.ar/kkk/Maildir/.Trash/curHeres the script I use, with my remarks for posting it here.Regards, Sergio /#!/bin/bash/ // /# qtprune.sh# # This file can be put in /etc/cron.daily # and will prune Trash/Spam directories # Nov 7, 2006 # # 3/5/2007 Added date configuration capability # # Erik A. Espinoza <//[EMAIL PROTECTED]/ <mailto:[EMAIL PROTECTED]> /# # # # Number of days for Trasn TRASH_DAYS="0" /[SM] b/c I want to delete all files there. /# Number of days for Spam SPAM_DAYS="28" # Find Trash Dir PATH_TRASH="`find /var/qmail/vpopmail/domains -type d -name .Trash`" # Find Spam Dir #PATH_SPAM="`find /home/vpopmail/domains -type d -name .Spam`"////# Exit if no spam or trash directories foundif [ -z "${PATH_TRASH}" ] && [ -z "${PATH_SPAM}" ]; then// /[SM] I also removed the && part but nothing/ exit 0 fi/// /# Delete Trash older than $TRASH_DAYS days# if Trash directories found if [ -n "${PATH_TRASH}" ]; then for each in "${PATH_TRASH}" ; do FILES_TO_DELETE="`find ${each} -type f -ctime +${TRASH_DAYS}`" 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 fi/// [SM] dont need this part./# Learn and Delete Spam older than $SPAM_DAYS # days if Spam directories found #if [ -n "${PATH_SPAM}" ]; then # for each in "${PATH_SPAM}" ; do # FILES_TO_DELETE="`find ${each} -type f -ctime +${SPAM_DAYS}`" # if [ -n "${FILES_TO_DELETE}" ]; then # for file in ${FILES_TO_DELETE} ; do # if [ -n ${file} ]; then # sudo -u vpopmail -H sa-learn --spam ${file} >/dev/null 2>&1 # rm -f ${file} >/dev/null 2>&1 # fi # done # fi # done # fi/
---------------------------------------------------------------------
QmailToaster hosted by: VR Hosted <http://www.vr.org>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
