TPT (Tiny Python Tip): Automatically Get Rid Of Duplicates with Liten and Supervisor

by Noah Gift

If you work in an media industry you might often have a problem of a common directory in which duplicate files get placed constantly. The duplicate files could be fonts, mp3 files, quicktime files, or whatever. One thing you could do is run a tool I wrote liten in a script via supervisor.

I recently added config file support, so you could setup an appropriate config file for liten, and then include it in another script with a sleep command:


#!/usr/bin/env/python
import time
from subprocess import call

time.sleep(3600)
call("liten.py --config=myconfig.ini", shell=True)


Tell supervisor to auto-restart this process and then you will have the duplicates cleaned out of that common directory every hour. This is a piece of cake with Supervisor and if you use it in this manner it can act as a more intelligent cron. Consult the manual for more details.

There is also an OS X Leopard Package for Liten available.

1 Comments

macdet
2008-04-29 00:03:44
clever thinking! i like the idee :)