Skip to content

Commit

Permalink
Add logrotate conf & cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Nov 27, 2023
1 parent 84f6126 commit 71a248c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions deploy_dqmgui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ install_crontab() {
crontab -l # Get existing crontabs
echo "17 2 * * * $INSTALLATION_DIR/current/config/dqmgui/daily"
echo "@reboot $INSTALLATION_DIR/current/config/dqmgui/manage sysboot"
echo "0 3 * * * logrotate $INSTALLATION_DIR/$DMWM_GIT_TAG/sw/cms/dqmgui/$DQMGUI_GIT_TAG/128/etc/logrotate.conf"
) | crontab -
}

Expand Down Expand Up @@ -285,6 +286,21 @@ install_dmwm() {
rm -rf $DMWM_TMP_DIR
}

# Create a configuration file for logrotate to manage...(surprise!) rotating logs.
_create_logrotate_conf() {
echo "# DQMGUI logrotate configuration file
# Automagically generated, please do not edit.
$INSTALLATION_DIR/state/dqmgui/*/logs/*.log {
compress
rotate 30
daily
noolddir
nomail
}
" >"$INSTALLATION_DIR/$DMWM_GIT_TAG/sw/cms/dqmgui/$DQMGUI_GIT_TAG/128/etc/logrotate.conf"
}

# env.sh and init.sh file creation. They're needed by other scripts (e.g. manage).
_create_env_and_init_sh() {
mkdir -p "$INSTALLATION_DIR/$DMWM_GIT_TAG/sw/cms/dqmgui/$DQMGUI_GIT_TAG/128/etc/profile.d/"
Expand Down Expand Up @@ -452,6 +468,7 @@ install_dqmgui() {
# during the compilation procedure.
_create_makefile_ext

_create_logrotate_conf
# TODO: find more info on blacklist.txt file
}

Expand Down

0 comments on commit 71a248c

Please sign in to comment.