Large text files can become a bottleneck if not indexed properly. If your upfiles.txt is growing rapidly:
cd work/raw md5sum * | sort | awk 'BEGINlasthash="" if($1==lasthash) print $2 ; lasthash=$1 ' | xargs -r rm packs cp upfiles txt better