Created
September 5, 2012 19:07
-
-
Save eliocapelati/3642724 to your computer and use it in GitHub Desktop.
ShellScript para limpar diretório de aplicativo do Glassfish no ambiente windows com cygwin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#caso queira utilizar em ambiente unix, mudar linha abaixo para o diretório base do glassfish | |
BASE=/cygdrive/c/java/glassfish3 | |
echo ":::::::::::::Parando Glassfish:::::::::::::" | |
cd $BASE/bin | |
./asadmin stop-domain | |
echo "::::::::::::: Indo para o diretório onde ficam o as aplicacoes::::::::" | |
echo "Apagando conteudo de : /glassfish/domains/domain1/applications" | |
for n in $(ls -d $BASE/glassfish/domains/domain1/applications/* | grep -v -e "__internal" -e "ejb-timer-service-app" -e "wstx-services") \ | |
$(ls -d $BASE/glassfish/domains/domain1/generated/ejb/* | grep -v -e "__admingui" -e "ejb-timer-service-app" -e "wstx-services") \ | |
$(ls -d $BASE/glassfish/domains/domain1/generated/jsp/* | grep -v -e "__admingui" -e "__default-web-module-__asadmin" -e "__default-web-module-server" -e "ejb-timer-service-app" -e "wstx-services") \ | |
$(ls -d $BASE/glassfish/domains/domain1/generated/policy/* | grep -v -e "__admingui" -e "__default-web-module" -e "ejb-timer-service-app" -e "wstx-services") \ | |
$(ls -d $BASE/glassfish/domains/domain1/generated/xml/* | grep -v -e "__admingui" -e "ejb-timer-service-app" -e "wstx-services") | |
do | |
rm -rf "$n" | |
done | |
for n in $(ls -d $BASE/glassfish/domains/domain1/logs/* $BASE/glassfish/domains/domain1/osgi-cache/felix/* 2> /dev/null) | |
do | |
rm -rf "$n" | |
done | |
echo "Script executado" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[pt-BR] Tenha em mente que esse script não apaga o conteúdo do descritor do domain, que fica em BASE/glassfish/domains/domain1/config/domain.xml. as aplicações ficam descritas aqui.
[en] Keep in mind that this script does not erase the contents of the descriptor domain, which is in BASE/glassfish/domains/domain1/config/domain.xml. applications are described here.