From: Arne Fitzenreiter Date: Thu, 30 Jan 2025 11:52:51 +0000 (+0100) Subject: collectd: another fix at converting rrd databases X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7909dc2194718f7f929261cd33fba06f145fd856;p=people%2Fmfischer%2Fipfire-2.x.git collectd: another fix at converting rrd databases Signed-off-by: Arne Fitzenreiter --- diff --git a/config/backup/backup.pl b/config/backup/backup.pl index c64d56aee..3c33608c5 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -272,11 +272,11 @@ restore_backup() { mv -f /var/log/rrd/collectd/localhost/cpufreq/cpufreq-$i.rrd \ /var/log/rrd/collectd/localhost/cpufreq-$i/cpufreq.rrd fi - done - if [ -e /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperature-temperature.rrd ]; then - mv -f /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperature-temperature.rrd \ - /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperature.rrd + if [ -e /var/log/rrd/collectd/localhost/thermal-thermal_zone$i/temperature-temperature.rrd ]; then + mv -f /var/log/rrd/collectd/localhost/thermal-thermal_zone$i/temperature-temperature.rrd \ + /var/log/rrd/collectd/localhost/thermal-thermal_zone$i/temperature.rrd fi + done # Create collectd 4.x to 5.x migration script from rrd contents, run the script that # was created and then remove the old interface directory if it is present as it will diff --git a/config/rootfiles/core/192/update.sh b/config/rootfiles/core/192/update.sh index 858c27d2f..072a45dda 100644 --- a/config/rootfiles/core/192/update.sh +++ b/config/rootfiles/core/192/update.sh @@ -116,11 +116,11 @@ do mv -f /var/log/rrd/collectd/localhost/cpufreq/cpufreq-$i.rrd \ /var/log/rrd/collectd/localhost/cpufreq-$i/cpufreq.rrd fi -done -if [ -e /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperature-temperature.rrd ]; then - mv -f /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperature-temperature.rrd \ - /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperature.rrd + if [ -e /var/log/rrd/collectd/localhost/thermal-thermal_zone$i/temperature-temperature.rrd ]; then + mv -f /var/log/rrd/collectd/localhost/thermal-thermal_zone$i/temperature-temperature.rrd \ + /var/log/rrd/collectd/localhost/thermal-thermal_zone$i/temperature.rrd fi +done /var/ipfire/collectd-migrate-4-to-5.pl --indir /var/log/rrd/ > /tmp/rrd-migrate.sh sh /tmp/rrd-migrate.sh >/dev/null 2>&1 rm -rvf \