Skip to content

Instantly share code, notes, and snippets.

@toodooleedoo
Last active February 18, 2016 16:37
Show Gist options
  • Save toodooleedoo/9790ca94ef96d907b37e to your computer and use it in GitHub Desktop.
Save toodooleedoo/9790ca94ef96d907b37e to your computer and use it in GitHub Desktop.
MP #AEM #NIX dispather cache cleaner

#MP #AEM #NIX dispather cache cleaner

Due to an issue where pages were being corrupted this was placed to search for incorrect HTML files in the dispatcher cache and cleanup as needed. Was a quick workaround.

#!/bin/sh
MAP="akl ath bei brn bru cph dub dvt fra hel ist kgh lhm lis lon mad mex mil na ndh ngo par pdrm1 saf sao sas sou sto syd tlv vie"
LOGFILE=/apps/cache-cleanup/cache_cleaner_`date '+%d%m'`.log
> ${LOGFILE}
cd /apps/oracleAS/prod/mid/Apache/Apache/htdocs/ONLINE/dispatcher/cache/publish/content/01/;
for val in ${MAP}; do
grep -r "publish/content/01" ${val}/* |grep -v "/${val}" |grep -v "/ic" |grep -v "affiliate" |grep "<li" |awk -F: '{print $1}' |while read line; do
rm -f ${line}
echo "REMOVING - `date` - ${line}" |tee -a ${LOGFILE}
done;
grep -r -E '(<div class="mega_menu_item_wrapper.*"><\/div>)' ${val}/* |awk -F: '{print $1}' |while read line; do
rm -f ${line}
echo "REMOVING - `date` - ${line}" |tee -a ${LOGFILE}
done;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment