#!/bin/bash # #Cleans up old oozie workflow and beeswax savedqueries to #prevent the DB from getting too large. PARCEL_DIR=/opt/cloudera/parcels/CDH LOG_FILE=/var/log/hue_history_cron.log LOG_ROTATE_SIZE=10 #MB before rotating, size in MB before rotating log to .1 LOG_ROTATE_COUNT=2 #number of log files, so 20MB max DATE=`date '+%Y%m%d-%H%M'` KEEP_DAYS=7 #Number of days of beeswax and oozie history to keep if [ ! -d "/usr/lib/hadoop" ] then CDH_HOME=$PARCEL_DIR else CDH_HOME=/usr fi if [ -d "/var/run/cloudera-scm-agent/process" ] then HUE_CONF_DIR="/var/run/cloudera-scm-agent/process/`ls -1 /var/run/cloudera-scm-agent/process | grep HUE | sort -n | tail -1 `" else HUE_CONF_DIR="/etc/hue/conf" fi if [ -d "${CDH_HOME}/lib/hue/build/env/bin" ] then COMMAND="${CDH_HOME}/lib/hue/build/env/bin/hue shell" else COMMAND="${CDH_HOME}/share/hue/build/env/bin/hue shell" fi export CDH_HOME HUE_CONF_DIR COMMAND ${COMMAND} <