Commit 406db3cf authored by fwinkler's avatar fwinkler

Revised logrotate script.

parent 15e04a58
COLLECTD_LOGFILE {
/tmp/pika_collectd.log {
su root root
......@@ -18,7 +18,7 @@ dateext
#compress
prerotate
PREROTATE_SCRIPT
/sw/taurus/tools/pika/daemon/logrotate/pika_prerotate.sh
endscript
}
#!/bin/bash
# determine logfile and prelocate file for pika_logrotate.conf
sed "/COLLECTD_LOGFILE/c ${COLLECTD_LOGFILE} {" \
${PIKA_ROOT}/daemon/logrotate/pika_logrotate_template.conf > ${PIKA_LOGPATH}/pika_logrotate.conf
sed -i "/PREROTATE_SCRIPT/c ${PIKA_ROOT}/daemon/logrotate/pika_prerotate.sh" \
${PIKA_LOGPATH}/pika_logrotate.conf
# check if pika_lograte.sh is in /etc/cron.daily
if [ ! -f "/etc/cron.daily/pika_lograte.sh" ]; then
cp ${PIKA_ROOT}/daemon/logrotate/pika_logrotate.sh /etc/cron.daily
fi
\ No newline at end of file
......@@ -48,6 +48,8 @@ fi
##### (5) pika package installation
lock_collectd=${LOCAL_STORE}/pika_collectd_setup.lock
# install pika python and likwid in /opt/pika if it is not already there
if [ ! -d "${PIKA_INSTALL_PATH}" ]; then
echo -e "\nInstall/Replace PIKA software stack to ${PIKA_INSTALL_PATH}" >> $DEBUG_PATH 2>&1
......@@ -92,7 +94,10 @@ fi
##### (6) pika presetup
# setup logrotate
source ${PIKA_ROOT}/job_control/slurm/taurus/pika_logrotate_prolog_include.sh >> $DEBUG_PATH 2>&1
# check if pika_lograte.sh is in /etc/cron.daily
if [ ! -f "/etc/cron.daily/pika_lograte.sh" ]; then
cp ${PIKA_ROOT}/daemon/logrotate/pika_logrotate.sh /etc/cron.daily >> $DEBUG_PATH 2>&1
fi
# check python
echo -e "\nCheck python3 path:" >> $DEBUG_PATH 2>&1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment