]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
collectd: another fix at converting rrd databases
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 30 Jan 2025 11:52:51 +0000 (12:52 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 30 Jan 2025 11:52:51 +0000 (12:52 +0100)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/backup/backup.pl
config/rootfiles/core/192/update.sh

index c64d56aee7d532e642972295433a1955b04e0bfe..3c33608c54e0d6e46fffc64921624cfef267e7e7 100644 (file)
@@ -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
index 858c27d2fb0b8178081e38732656efe2c7664c35..072a45dda3450109a0b455ab6a8ad74593c9ac79 100644 (file)
@@ -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 \