HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] large number of fax destinations



"Jay R. Ashworth" wrote:
> 
...
> Hey, Jeff?  Could you extract a patch from that and hang in out our
> Bugzilla as an enhancement request?  That seems like a generally useful
...

I have done a little upgrading of faxcron several years ago (and
now aplied to 4.1beta3) for deleting old files in doneq/docq.
If you like it:

--- faxcron.ORIG	Thu Feb 22 17:00:04 2001
+++ faxcron	Thu Feb 22 18:39:05 2001
@@ -39,7 +39,8 @@
 
 AGEINFO=30			# purge remote info after 30 days inactivity
 AGELOG=30			# keep log info for last 30 days
 AGERCV=7			# purge received facsimile after 7 days
+AGEDONE=2			# purge files in doneq/docq after 2 days
 AGETMP=1			# purge orphaned temp files after 1 day
 FAXUSER=fax			# owner of log files
 LOGMODE=0644			# mode for log files
@@ -83,9 +84,10 @@
     -info)  shift; AGEINFO="$1";;
     -log)   shift; AGELOG="$1";;
     -rcv)   shift; AGERCV="$1";;
+    -done)  shift; AGEDONE="$1";;
     -tmp)   shift; AGETMP="$1";;
     -mode)  shift; LOGMODE="$1";;
-    -*)	    echo "Usage: $0 [-n] [-l lastrun] [-info days] [-log days]
[-rcv days] [-tmp days] [-mode logmode]"; exit 1;;
+    -*)	    echo "Usage: $0 [-n] [-l lastrun] [-info days] [-log days]
[-rcv days] [-done days] [-tmp days] [-mode logmode]"; exit 1;;
     esac
     shift
 done
@@ -428,6 +430,31 @@
 '
 else
     echo "Nothing to purge in receive queue."
+fi
+echo ""
+
+#
+# Purge old stuff from the done and document queue.
+#
+find doneq -type f -mtime +$AGEDONE -print >$JUNK
+if [ -s $JUNK ]; then
+    echo "Purge documents older than $AGEDONE days:"
+    for i in `$CAT $JUNK`; do
+        DOCNAME=`$GREP '^!postscript:' $i` 2>/dev/null
+        echo -n "    Remove $i"
+        $RM $i
+        if [ "x${DOCNAME}" != "x" ]; then
+            DOCNAME=${DOCNAME##*:}
+            if [ -r $DOCNAME ]; then
+                echo -n " - $DOCNAME"
+                $RM $DOCNAME
+            fi
+        fi
+        echo ""
+    done
+    echo ""
+else
+    echo "Nothing to purge in done or document queue."
 fi
 echo ""
 
-- 
------------------------------------------------------------------------
  Heinz-Ado Arnolds                           Ado.Arnolds@dhm-systems.de
  DHM GmbH & Co. KG                              +49 2234 18400  (voice)
  Max-Planck-Strasse 2, 50858 Koeln, Germany     +49 2234 184040 (fax)


____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null




Project hosted by iFAX Solutions