luci/applications/luci-app-statistics
Hosted Weblate 9068c65ca1 Translated using Weblate (Swedish)
Currently translated at 93.2% (55 of 59 strings)

Translation: OpenWrt/LuCI/applications/nft-qos
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsnft-qos/sv/

Translated using Weblate (Swedish)

Currently translated at 100.0% (38 of 38 strings)

Translation: OpenWrt/LuCI/applications/advanced-reboot
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadvanced-reboot/sv/

Translated using Weblate (Swedish)

Currently translated at 5.0% (2 of 40 strings)

Translation: OpenWrt/LuCI/applications/cloudflared
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationscloudflared/sv/

Translated using Weblate (Swedish)

Currently translated at 21.2% (7 of 33 strings)

Translation: OpenWrt/LuCI/applications/v2raya
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsv2raya/sv/

Translated using Weblate (Swedish)

Currently translated at 2.0% (1 of 48 strings)

Translation: OpenWrt/LuCI/applications/openwisp
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopenwisp/sv/

Translated using Weblate (Swedish)

Currently translated at 4.3% (2 of 46 strings)

Translation: OpenWrt/LuCI/applications/xfrpc
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsxfrpc/sv/

Translated using Weblate (Swedish)

Currently translated at 5.8% (1 of 17 strings)

Translation: OpenWrt/LuCI/applications/eoip
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationseoip/sv/

Translated using Weblate (Swedish)

Currently translated at 27.5% (11 of 40 strings)

Translation: OpenWrt/LuCI/applications/example
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsexample/sv/

Translated using Weblate (Swedish)

Currently translated at 3.0% (2 of 66 strings)

Translation: OpenWrt/LuCI/applications/sshtunnel
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssshtunnel/sv/

Translated using Weblate (Swedish)

Currently translated at 3.4% (3 of 88 strings)

Translation: OpenWrt/LuCI/applications/mosquitto
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsmosquitto/sv/

Translated using Weblate (Swedish)

Currently translated at 21.0% (4 of 19 strings)

Translation: OpenWrt/LuCI/applications/irqbalance
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsirqbalance/sv/

Translated using Weblate (Swedish)

Currently translated at 3.0% (6 of 198 strings)

Translation: OpenWrt/LuCI/applications/smartdns
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssmartdns/sv/

Translated using Weblate (Swedish)

Currently translated at 51.5% (17 of 33 strings)

Translation: OpenWrt/LuCI/applications/alist
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsalist/sv/

Translated using Weblate (Swedish)

Currently translated at 95.0% (19 of 20 strings)

Translated using Weblate (Swedish)

Currently translated at 52.9% (54 of 102 strings)

Translated using Weblate (Swedish)

Currently translated at 32.4% (764 of 2353 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/sv/

Translated using Weblate (Portuguese)

Currently translated at 60.0% (24 of 40 strings)

Translation: OpenWrt/LuCI/applications/cloudflared
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationscloudflared/pt/

Translated using Weblate (Portuguese)

Currently translated at 27.2% (9 of 33 strings)

Translation: OpenWrt/LuCI/applications/v2raya
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsv2raya/pt/

Translated using Weblate (Portuguese)

Currently translated at 2.0% (1 of 48 strings)

Translation: OpenWrt/LuCI/applications/openwisp
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopenwisp/pt/

Translated using Weblate (Portuguese)

Currently translated at 10.8% (5 of 46 strings)

Translation: OpenWrt/LuCI/applications/xfrpc
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsxfrpc/pt/

Translated using Weblate (Portuguese)

Currently translated at 100.0% (19 of 19 strings)

Translation: OpenWrt/LuCI/applications/irqbalance
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsirqbalance/pt/

Translated using Weblate (Portuguese)

Currently translated at 2.0% (4 of 198 strings)

Translation: OpenWrt/LuCI/applications/smartdns
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssmartdns/pt/

Translated using Weblate (Portuguese)

Currently translated at 93.9% (31 of 33 strings)

Translation: OpenWrt/LuCI/applications/alist
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsalist/pt/

Translated using Weblate (Portuguese)

Currently translated at 100.0% (164 of 164 strings)

Translation: OpenWrt/LuCI/applications/adblock-fast
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadblock-fast/pt/

Translated using Weblate (Portuguese)

Currently translated at 100.0% (16 of 16 strings)

Translation: OpenWrt/LuCI/applications/hd-idle
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationshd-idle/pt/

Translated using Weblate (Portuguese)

Currently translated at 98.3% (240 of 244 strings)

Translation: OpenWrt/LuCI/applications/banip
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsbanip/pt/

Translated using Weblate (Portuguese)

Currently translated at 100.0% (197 of 197 strings)

Translation: OpenWrt/LuCI/applications/ddns
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsddns/pt/

Translated using Weblate (Portuguese)

Currently translated at 100.0% (102 of 102 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (46 of 46 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (183 of 183 strings)

Translated using Weblate (Portuguese)

Currently translated at 99.6% (279 of 280 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (376 of 376 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (25 of 25 strings)

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (21 of 21 strings)

Translation: OpenWrt/LuCI/applications/tor
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationstor/zh_Hans/

Translated using Weblate (Polish)

Currently translated at 100.0% (21 of 21 strings)

Translation: OpenWrt/LuCI/applications/tor
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationstor/pl/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (164 of 164 strings)

Translation: OpenWrt/LuCI/applications/adblock-fast
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadblock-fast/zh_Hans/

Translated using Weblate (Polish)

Currently translated at 100.0% (164 of 164 strings)

Translation: OpenWrt/LuCI/applications/adblock-fast
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadblock-fast/pl/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (194 of 194 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (194 of 194 strings)

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (83 of 83 strings)

Translated using Weblate (Polish)

Currently translated at 100.0% (83 of 83 strings)

Translated using Weblate (Russian)

Currently translated at 100.0% (21 of 21 strings)

Translation: OpenWrt/LuCI/applications/tor
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationstor/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (164 of 164 strings)

Translation: OpenWrt/LuCI/applications/adblock-fast
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadblock-fast/ru/

Translated using Weblate (Lithuanian)

Currently translated at 100.0% (83 of 83 strings)

Translated using Weblate (Lithuanian)

Currently translated at 50.5% (45 of 89 strings)

Translation: OpenWrt/LuCI/applications/frpc
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfrpc/lt/

Translated using Weblate (Lithuanian)

Currently translated at 48.4% (32 of 66 strings)

Translation: OpenWrt/LuCI/applications/frps
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfrps/lt/

Translated using Weblate (Lithuanian)

Currently translated at 98.5% (2320 of 2355 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/lt/

Translated using Weblate (Russian)

Currently translated at 100.0% (194 of 194 strings)

Translated using Weblate (Russian)

Currently translated at 100.0% (83 of 83 strings)

Translated using Weblate (Lithuanian)

Currently translated at 60.3% (117 of 194 strings)

Translated using Weblate (Lithuanian)

Currently translated at 61.1% (118 of 193 strings)

Translated using Weblate (Swedish)

Currently translated at 1.1% (1 of 88 strings)

Translation: OpenWrt/LuCI/applications/mosquitto
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsmosquitto/sv/

Translated using Weblate (Italian)

Currently translated at 88.2% (143 of 162 strings)

Translation: OpenWrt/LuCI/applications/adblock-fast
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadblock-fast/it/

Translated using Weblate (Lithuanian)

Currently translated at 58.0% (112 of 193 strings)

Translated using Weblate (Italian)

Currently translated at 21.5% (31 of 144 strings)

Translation: OpenWrt/LuCI/applications/https-dns-proxy
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationshttps-dns-proxy/it/

Translated using Weblate (Italian)

Currently translated at 83.3% (20 of 24 strings)

Translation: OpenWrt/LuCI/applications/lxc
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationslxc/it/

Translated using Weblate (Italian)

Currently translated at 73.0% (19 of 26 strings)

Translation: OpenWrt/LuCI/applications/dcwapd
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsdcwapd/it/

Translated using Weblate (Italian)

Currently translated at 99.5% (243 of 244 strings)

Translation: OpenWrt/LuCI/applications/banip
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsbanip/it/

Translated using Weblate (Italian)

Currently translated at 100.0% (51 of 51 strings)

Translated using Weblate (Italian)

Currently translated at 83.7% (31 of 37 strings)

Translated using Weblate (Italian)

Currently translated at 68.9% (40 of 58 strings)

Translated using Weblate (Lithuanian)

Currently translated at 64.7% (11 of 17 strings)

Translation: OpenWrt/LuCI/applications/omcproxy
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsomcproxy/lt/

Translated using Weblate (Lithuanian)

Currently translated at 62.8% (71 of 113 strings)

Translated using Weblate (Lithuanian)

Currently translated at 93.2% (55 of 59 strings)

Translation: OpenWrt/LuCI/applications/nft-qos
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsnft-qos/lt/

Translated using Weblate (Lithuanian)

Currently translated at 100.0% (20 of 20 strings)

Translation: OpenWrt/LuCI/applications/ltqtapi
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsltqtapi/lt/

Translated using Weblate (Lithuanian)

Currently translated at 53.5% (98 of 183 strings)

Translated using Weblate (Lithuanian)

Currently translated at 100.0% (28 of 28 strings)

Translation: OpenWrt/LuCI/applications/acl
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsacl/lt/

Translated using Weblate (Polish)

Currently translated at 100.0% (2355 of 2355 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/pl/

Translated using Weblate (Russian)

Currently translated at 100.0% (2355 of 2355 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/ru/

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (2355 of 2355 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/zh_Hans/

Translated using Weblate (Italian)

Currently translated at 99.8% (2352 of 2355 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/it/

Co-authored-by: Džiugas J <dziugas1959@hotmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Kristoffer Grundström <swedishsailfishosuser@tutanota.com>
Co-authored-by: Matthaiks <kitynska@gmail.com>
Co-authored-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
Co-authored-by: Random <random-r@users.noreply.hosted.weblate.org>
Co-authored-by: SKAL <sir_kalot@yahoo.it>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: st7105 <st7105@gmail.com>
Co-authored-by: 大王叫我来巡山 <hamburger2048@users.noreply.hosted.weblate.org>
Signed-off-by: Džiugas J <dziugas1959@hotmail.com>
Signed-off-by: Kristoffer Grundström <swedishsailfishosuser@tutanota.com>
Signed-off-by: Matthaiks <kitynska@gmail.com>
Signed-off-by: Paul Dee <itsascambutmailmeanyway@gmail.com>
Signed-off-by: Random <random-r@users.noreply.hosted.weblate.org>
Signed-off-by: SKAL <sir_kalot@yahoo.it>
Signed-off-by: ssantos <ssantos@web.de>
Signed-off-by: st7105 <st7105@gmail.com>
Signed-off-by: 大王叫我来巡山 <hamburger2048@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfirewall/pt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsminidlna/pt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsnatmap/sv/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsolsr/lt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsolsr/pt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopenvpn/lt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopenvpn/pl/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopenvpn/ru/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopenvpn/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopkg/lt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopkg/pl/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopkg/ru/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopkg/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationspolipo/it/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsqos/pt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsradicale2/lt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsstatistics/pt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationstransmission/pt/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationstransmission/sv/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsupnp/it/
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationswatchcat/it/
Translation: OpenWrt/LuCI/applications/firewall
Translation: OpenWrt/LuCI/applications/minidlna
Translation: OpenWrt/LuCI/applications/natmap
Translation: OpenWrt/LuCI/applications/olsr
Translation: OpenWrt/LuCI/applications/openvpn
Translation: OpenWrt/LuCI/applications/opkg
Translation: OpenWrt/LuCI/applications/polipo
Translation: OpenWrt/LuCI/applications/qos
Translation: OpenWrt/LuCI/applications/radicale2
Translation: OpenWrt/LuCI/applications/statistics
Translation: OpenWrt/LuCI/applications/transmission
Translation: OpenWrt/LuCI/applications/upnp
Translation: OpenWrt/LuCI/applications/watchcat
2024-02-16 21:52:28 +02:00
..
htdocs/luci-static/resources luci-app-statistics: lookup -> look up 2023-12-19 20:44:58 +01:00
po Translated using Weblate (Swedish) 2024-02-16 21:52:28 +02:00
root luci-app-statistics: Add rrd backup option to config file 2024-02-03 11:59:31 +02:00
Makefile luci-app-statistics: rewrite stat-genconfig in ucode 2022-10-25 01:03:37 +02:00
README.md luci-app-statistics: Add backup/restore for RRD statistics 2023-10-29 19:48:38 -04:00

Backups

The backup scheme implemented in /etc/init.d/luci_statistics aims to limit writes to stable storage, to preserve flash memory lifetime. (Flash-memory based routers may have limited lifetime of write cycles, we want to conserve those.) While it would be simpler to run a periodic backup as a cron job, you'd risk wearing out the flash memory. This scheme only writes backups to flash during shutdowns/reboots and upgrades.

The backup is only enabled if the administrator sets luci_statistics.collectd_rrdtool.backup=1.

We only want to restore a sysupgrade backup file if:

  1. It was installed by sysupgrade -r (restore configuration files), and we have rebooted. In this case, there is an orderly shutdown that calls the shutdown methods. We do not want to overwrite the restored sysupgrade backup file during shutdown, but after reboot we do want to restore it.

  2. It was generated during a true sysupgrade, and we are rebooting into the new image: sysupgrade with any or none of -o, -c, -f, -u, resulting in a new image being installed and a config file being preserved for processing after reboot. In this case we do not want to overwrite the backup while rebooting during the upgrade. sysupgrade in this case stores a .tgz archive of all preserved files where it can be found after rebooting into the new image, and it does not run the shutdown scripts before rebooting.

When the administrator runs sysupgrade -b (command line or LuCI), we create a sysupgrade backup file and it is included in the combined backup. Then the system continues running. When we later stop or restart or reboot (orderly conditions, when /etc/init.d/luci_statistics is called to shut down), we do not want to use the saved sysupgrade backup. If we had a control path after sysupgrade -b that would allow us to remove the sysupgrade backup, this would be simple. But we don't!

What we can do is arrange that a sysupgrade backup contains enough information to indicate if it should be restored.

  1. True sysupgrade is straightforward: we arrange that the backed-up file list only includes the sysupgrade backup file and one twin file (see below). The next starting of /etc/init.d/luci_statistics after a sysupgrade will restore the sysupgrade backup.

  2. Continued system operation after sysupgrade -b: next time we stop the service (during reboot or during other init script actions), we check for a stale sysupgrade backup, and if we detect it we remove it.

  3. sysupgrade -r only unpacks the backup files, it does not erase other non-backed-up files still in the overlay. Its intended use is to then immediately reboot, which will run an orderly shutdown/normal backup. We must ensure the orderly shutdown in this case preserves the sysupgrade backup, unlike the previous case.

To implement these cases, we use a pair of twinned files, only one of which is included in the list of files preserved by sysupgrade. If we detect mismatched files (or only one file present) during service shutdown or startup, we trust that the sysupgrade backup should be kept and restored. If the files are matched, that indicates that we have not restored files since the sysupgrade backup, and the current normal backup should be used instead.

During sysupgrade backup

/etc/init.d/luci_statistics sysupgrade_backup is invoked by sysupgrade for true upgrade or for the -l or -b flags. We detect the list flag (-l) by checking the process environment, and if found, we only generate a list: we don't actually do a backup. For all cases, we edit the list of files listed already and remove any other mentions of /etc/luci_statistics to ensure that only the backup file and one of the twin files is in the backup list.

During sysupgrade

During a true sysupgrade, only the sysupgrade backup file and one of the twin files is restored after the image reboots, so the first running of startup scripting will restore the sysupgrade backup. This could be at the time of first boot, if the image has been built to include this package, or it could be later when the package is downloaded, installed, and the service is started.

During backup (including orderly shutdown)

During backup (run during shutdown), if there is a matched set of twins, then we know that sometime since the last service start the administrator ran sysupgrade -b and had the chance to copy the resulting backup. We can now erase the twins and the sysupgrade backup.

If there is a mismatched set of twins, then someone restored a backup such as with sysupgrade -r and we should now be rebooting, so we should leave the sysupgrade files alone to be processed on service restart (after reboot).

If someone takes a sysupgrade -b backup and then restores it before they reboot or restart statistics, the twins will still match, and we then don't keep the statistics from the restored backup, we instead take a new backup from current data and use that on reboot.

During startup

If there are matched twin files (the normal case for shutdown/reboot without sysupgrade), then the sysupgrade backup is ignored and the regular backup is restored. If there are mismatched twin files, then the sysupgrade backup is restored.

During disorderly reboot

In a system crash or other disorderly reboot, the shutdown scripts do not run. What remains on the system is the previous contents of /etc/luci_statistics.

  • If the system never started luci_statistics, or it was cleanly shut down before the crash, then there is no difference in behavior from normal startup: we restore either the sysupgrade backup (if luci_statistics had never run) or the regular backup (if luci_statistics was cleanly stopped)

  • If luci_statistics and collectd were running at the time of the crash, there could be a regular backup and a sysupgrade backup present, plus volatile data in /tmp (which are lost in the crash). The regular backup would be from the most recent time the system cleanly stopped luci_statistics. During the subsequent reboot/service start up:

    • If there is a sysupgrade backup on disk from having run sysupgrade -b, with both twin files matching (meaning the administrator had taken a backup sometime during the life of the system, before the crash), they are ignored and a regular backup (if any) is restored.

    • If the sysupgrade backup has mismatched twin files or only one twin, then it is used to restore state. This would be the case if a sysupgrade restored configuration (sysupgrade -r), whether or not it did an orderly shutdown/reboot, or if the file system were damaged in a crash and only one of the twin files survived.