[ic] catalog tmp files - periodically purging these files

Jon Jensen jon at endpoint.com
Sat Aug 27 10:57:29 EDT 2005

On Sat, 27 Aug 2005, John1 wrote:

> I was doing some housekeeping the other day and decided to delete the 
> temporary files in the catalog/my_catalog/tmp directory.
> To my surprise it freed up about 2GB of disk space!
> As far as I am aware, all of these files were no bigger than about 4K, so 2GB 
> makes for a lot of temporary files!
> So I guess Interchange never trims the contents of this tmp directory. Should 
> it be?  Can I safely do this through a cron job, and if so any suggestions on 
> a criteria for the trimming, or better still an example script?

Nope -- Interchange doesn't remove any old files. That's up to you, to do 
according to each site's needs.

> BTW, what are all these files - from looking at the contents in a text editor 
> it looks like they have  something to do with the Interchange search (i.e. 
> Scan) routine?

The session files are ... sessions. :) The tmp files are more-list paging 
files and some other assorted things.



You're using files, not DBM sessions, so look at the examples for purging 
old files. I've attached the little shell script I often use to clear 
session, tmp, and timed (for timed-build output files) files that are more 
than a day old.


Jon Jensen
End Point Corporation
-------------- next part --------------

# purge-ic-work-files
# Jon Jensen <jon at endpoint.com>
# Purges Interchange session, tmp, and timed build files. To be run once or
# more daily from cron, with nice. Tries to avoid stomping on non-IC tmp files
# by checking that catalog.cfg exists in the catalog directory.
# $Id: purge-ic-work-files,v 1.3 2004/09/27 13:35:38 jon Exp $

for i in $HOME/catalogs/*
	[ -f $i/catalog.cfg ] || continue
	for j in $i/{session,tmp,timed}
		[ -d $j ] || continue
		cd $j || exit 1
		echo "Working in $j" >&2

		echo "... Removing old files" >&2
		find . -type f -follow -mtime +1 | xargs -r rm -f

		echo "... Removing empty directories" >&2
		find . -type d -follow -mindepth 2 -empty | xargs -r rmdir --ignore-fail-on-non-empty

More information about the interchange-users mailing list