Changeset 7812


Ignore:
Timestamp:
Jul 26, 2018, 12:33:53 PM (12 months ago)
Author:
mabarracus
Message:

Fix crontab file when root needs password

Location:
lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/etc/cron.weekly
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/etc/cron.weekly/analytics_purge_old_data

    r7280 r7812  
    11#!/bin/bash
    2 mysql -D analytics < /usr/lib/analytics-server/purge_old_data.sql
     2PWFILE=/etc/lliurex-analytics-server/config_db
     3if [ -f "${PWFILE}" ]; then
     4    USER=""
     5    PW=""
     6    USER="$(egrep -i '^user=' ${PWFILE}|cut -d'=' -f2)"
     7    PW="$(egrep -i '^pass=' ${PWFILE}|cut -d'=' -f2)"
     8    if [ -n "${USER}" -a -n "${PW}" ]; then
     9        mysql -u${USER} -p${PW} -D analytics < /usr/lib/analytics-server/purge_old_data.sql
     10    fi
     11fi
Note: See TracChangeset for help on using the changeset viewer.