Date of last sync in dietpi-banner

As the title states. Would be nice to see when logging in.

Thanks!

maybe you can be more specific. What do you like to display?

When I go to dietpi-sync in the top of the resulting console it shows the data and time of my last sync. Thought it might be nice to see in the banner.

you could try to add it as custom field. Can you have a look if following file is existing on your target directory

.dietpi-sync.log

Basically you could do this yourself already by modifying dietpi-banner option #10


 ─────────────────────────────────────────────────────
 DietPi v8.3.1 : 2 APT updates available
 ─────────────────────────────────────────────────────
 - Device model : RPi 3 Model B+ (armv7l)
 - Uptime : up 8 minutes
 - CPU temp : 36 °C / 96 °F : Cool runnings
 - LAN IP : 192.168.0.12 (eth0)
 - Last Sync : 2022-04-21_14:12:15 [  OK  ] Sync completed
 ─────────────────────────────────────────────────────

 apt upgrade     : Run now to apply 2 available APT package upgrades

root@DietPi3:~#

There you could enter your custom code like this

 tail -1 /your/target/directory/.dietpi-sync.log

Give a name to the field and you are done.

That works.

Does that also work for the last backup? What would the command look like?
And can you show both last sync and backup information in Dietpi banner or is only one custom command possible?

Thanks
T

Yes, theoretically you could display everything. And with some format scripting you could even simulate 2 entries, for backup and sync.

tail -1 /mnt/dietpi-backup/.dietpi-backup_stats && echo -e '\e[38;5;154m -\e[0m\e[1m Sync Status\e[0m\e[38;5;154m :\e[0m' $(tail -1 /mnt/target/.dietpi-sync.log)

That’s how it will looks like

 ─────────────────────────────────────────────────────
 DietPi v8.3.1 : 4 APT updates available
 ─────────────────────────────────────────────────────
 - Device model : RPi 3 Model B+ (armv7l)
 - Uptime : up 1 day, 4 hours, 42 minutes
 - CPU temp : 40 °C / 104 °F : Optimal temperature
 - LAN IP : 192.168.0.12 (eth0)
 - Backup Status : Restore completed    : 2022-04-22_10:38:46
 - Sync Status : 2022-04-21_14:12:15 [ OK ] Sync completed
 ─────────────────────────────────────────────────────

 apt upgrade     : Run now to apply 4 available APT package upgrades

root@DietPi3:~#

Good stuff. Working!

Thanks a bunch.
T