#!/bin/sh
tmpl_root=/home/templates/template/public_html
logfile=/var/log/templates_list.log

echo "[`date`] $0 - START" >>${logfile}

for dir in Linux-testing FreeBSD-testing Linux-outdated FreeBSD-outdated Linux-eol FreeBSD-eol; do 

    find ${tmpl_root}/${dir} -name \*.tar.gz -print 2>>${logfile} | sed 's/^.\+\///g' > ${tmpl_root}/${dir}/templates.list 2>>${logfile};

done

echo "[`date`] $0 - FINISHED" >>${logfile}
