| 1 |
#!/bin/bash |
| 2 |
# old log structure |
| 3 |
|
| 4 |
if ! [[ -d /var/lib/torrus ]]; then |
| 5 |
exit 0 |
| 6 |
fi |
| 7 |
|
| 8 |
find /var/lib/torrus/collector_rrd -name '*.rrd' | \ |
| 9 |
sed 's/^\(.*\)/\1$ f VarFile/' |
| 10 |
|
| 11 |
TORRUS_TREES="" |
| 12 |
#shellcheck disable=SC2154 |
| 13 |
if [[ -r "${UPAC_settingsd}/31_aide_torrus_settings" ]]; then |
| 14 |
# pull in configuration |
| 15 |
#shellcheck disable=SC1090 |
| 16 |
. "${UPAC_settingsd}/31_aide_torrus_settings" |
| 17 |
fi |
| 18 |
|
| 19 |
for tree in ${TORRUS_TREES}; do |
| 20 |
printf "@@define TORRUS_TREE %s\\n" "${tree}" |
| 21 |
printf " /var/lib/torrus/db/sub/@@{TORRUS_TREE}/(config_readers|nodepcache_1|scheduler_stats)\\.db$ f VarFile\\n" |
| 22 |
printf " /var/log/torrus/collector\\.@@{TORRUS_TREE}_0\\.log$ f Log\\n" |
| 23 |
printf " /@@{RUN}/torrus/collector\\.@@{TORRUS_TREE}_0\\.pid$ f VarFile\\n" |
| 24 |
done |
| 25 |
|
| 26 |
printf "!/var/cache/torrus/[0-9a-f]{32}_[0-9]{5}$ f\\n" |
| 27 |
printf " /var/lib/torrus/db/__db\\.00[1234]$ f VarFile\\n" |
| 28 |
printf " /var/lib/torrus/db/render_cache\\.db$ f VarFile\\n" |
| 29 |
printf "!/var/lib/torrus/session_data/store/[0-9a-f]{32}$ f\\n" |
| 30 |
printf "!/var/lib/torrus/session_data/lock/Apache-Session-[0-9a-f]{32}\\.lock$ f\\n" |
| 31 |
printf " /var/lib/torrus/session_data/(store|lock)$ d VarDir\\n" |
| 32 |
CPID="$(pidof collector)" |
| 33 |
if [[ -n "${CPID}" ]]; then |
| 34 |
printf "!/var/log/torrus/dbenv_errlog_%d$ f\\n" "$(pidof collector)" |
| 35 |
fi |
| 36 |
printf " /var/log/torrus$ d VarDir\\n" |
| 37 |
printf " /@@{RUN}/torrus$ d RecreatedDir\\n" |
| 38 |
|
| 39 |
# vim:tabstop=2:expandtab:shiftwidth=2 |