Skip to content
Snippets Groups Projects
Commit 83949068 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

style: satisfy shellcheck

parent b7b152d3
No related branches found
No related tags found
1 merge request!2merge feat_ND-2363_ND-2323 into master
Pipeline #3384 passed
......@@ -12,7 +12,7 @@ PREVIOUS_YEAR="$(( CURRENT_YEAR - 1 ))"
[[ (! ${APP} =~ "disapp") && (! ${APP} =~ "subapp") && (! ${APP} =~ "subapp_webservice") ]] && \
echo 'ERROR: $1 needs to be one of "disapp", "subapp" or "subapp_webservice"'
cd "/var/log/$APP/" || exit 1
cd "/var/log/${APP}/" || exit 1
# create directories for old logfiles
for YEAR in $( seq ${START_YEAR} ${PREVIOUS_YEAR} ); do
......@@ -22,19 +22,19 @@ done
# move all old logfiles
for YEAR in $( seq ${START_YEAR} ${PREVIOUS_YEAR} ); do
if [[ "${APP}" == "disapp" ]]; then
if [[ -n $( find ./ -maxdepth 1 -name "disapp.log.${YEAR}-*.lz" ) ]]; then mv disapp.log.${YEAR}-*.lz "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "disapp.log.${YEAR}-*.lz" ) ]]; then mv "disapp.log.${YEAR}-*.lz" "old/${YEAR}/"; fi
fi
if [[ "${APP}" == "subapp" ]]; then
if [[ -n $( find ./ -maxdepth 1 -name "Protokoll_SLUBArchiv_Erfolgreich-${YEAR}*.log" ) ]]; then mv Protokoll_SLUBArchiv_Erfolgreich-${YEAR}*.log "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "Protokoll_SLUBArchiv_FEHLER-${YEAR}*.log" ) ]]; then mv Protokoll_SLUBArchiv_FEHLER-${YEAR}*.log "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "sips.log.${YEAR}-*.lz" ) ]]; then mv sips.log.${YEAR}-*.lz "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "subapp.log.${YEAR}-*.lz" ) ]]; then mv subapp.log.${YEAR}-*.lz "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "producer_mails.log.${YEAR}-*.lz" ) ]]; then mv producer_mails.log.${YEAR}-*.lz "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "staff_mails.log.${YEAR}-*.lz" ) ]]; then mv staff_mails.log.${YEAR}-*.lz "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "Protokoll_SLUBArchiv_Erfolgreich-${YEAR}*.log" ) ]]; then mv "Protokoll_SLUBArchiv_Erfolgreich-${YEAR}*.log" "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "Protokoll_SLUBArchiv_FEHLER-${YEAR}*.log" ) ]]; then mv "Protokoll_SLUBArchiv_FEHLER-${YEAR}*.log" "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "sips.log.${YEAR}-*.lz" ) ]]; then mv "sips.log.${YEAR}-*.lz" "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "subapp.log.${YEAR}-*.lz" ) ]]; then mv "subapp.log.${YEAR}-*.lz" "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "producer_mails.log.${YEAR}-*.lz" ) ]]; then mv "producer_mails.log.${YEAR}-*.lz" "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "staff_mails.log.${YEAR}-*.lz" ) ]]; then mv "staff_mails.log.${YEAR}-*.lz" "old/${YEAR}/"; fi
fi
if [[ "${APP}" == "subapp_webservice" ]]; then
if [[ -n $( find ./ -maxdepth 1 -name "webservice.log.${YEAR}-*.lz" ) ]]; then mv webservice.log.${YEAR}-*.lz "old/${YEAR}/"; fi
if [[ -n $( find ./ -maxdepth 1 -name "webservice.log.${YEAR}-*.lz" ) ]]; then mv "webservice.log.${YEAR}-*.lz" "old/${YEAR}/"; fi
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment