[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.

See:

http://www.icdevgroup.org/interchange-doc-5.2.0/icadvanced.html#Expiring%20Sessions

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


-- 
Jon Jensen
End Point Corporation
http://www.endpoint.com/
-------------- next part --------------
#!/bin/sh

# 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/*
do
	[ -f $i/catalog.cfg ] || continue
	for j in $i/{session,tmp,timed}
	do
		[ -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
	done
done


More information about the interchange-users mailing list