From 981735f42d3a118d8053f892175a2fecec720a0f Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Thu, 11 Sep 2014 19:18:58 +0530 Subject: [PATCH] ee site log --- bin/easyengine | 5 +++++ src/modules/stack/ee_cache_clean.sh | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index ac92761f..93af29b7 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -275,6 +275,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo_escape "\trestart\tRestart NGINX, PHP5, MySQL and Postfix service" fi + # EasyEngine site elif [ "$EE_FIRST" = "site" ]; then if [ "$EE_SECOND" = "list" ]; then @@ -542,6 +543,10 @@ elif [ "$EE_FIRST" = "site" ]; then # Execute: service nginx reload ee_lib_service nginx reload fi + elif [ "$EE_SECOND" = "log" ]; then + # tail -f log + ee_site_check_logs ${@:3}|| ee_lib_error "Unable to check logs, exit status = " $? + else ee_lib_echo "ee site commands:" ee_lib_echo_escape "\tlist\tList NGINX enabled website" diff --git a/src/modules/stack/ee_cache_clean.sh b/src/modules/stack/ee_cache_clean.sh index 0aeb776f..81aee59a 100644 --- a/src/modules/stack/ee_cache_clean.sh +++ b/src/modules/stack/ee_cache_clean.sh @@ -1,11 +1,16 @@ -#Clean all cache +# Clean all cache function ee_cache_clean() { - #Clean fastcgi cache - rm -rf $(grep fastcgi_cache_path /etc/nginx/conf.d/fastcgi.conf | awk '{ print $2 }' | sed 's/$/\/*/g') \ - || ee_lib_error "Unable to clean fastcgi cache, exit status = " $? + # Clean fastcgi cache + if [ -d /var/run/nginx-cache/ ]; then + rm -rf /var/run/nginx-cache/* &>> $EE_COMMAND_LOG + fi - #Clean memcache - service memcached restart &>> $EE_COMMAND_LOG || ee_lib_error "Unable to clean memcache, exit status = " $? -} \ No newline at end of file + # Clean memcache + dpkg --get-selections | grep -v deinstall | grep memcached &>> $EE_COMMAND_LOG + + if [ $? -eq 0 ];then + service memcached restart &>> $EE_COMMAND_LOG + fi +}