DietPi-Backup interactive non-interactive restore

By inserting an USB external drive on the Pi, with many backups on it, the procedure (non-interactive) will automatically always choose the LATEST backup by date?

Can you be more specific on your question and probably give some examples.

I have three backups done by DietPi-Backup on an external USB unit.

With the “non interactive” restore, DietPi will automatically choose to restore the most recent backup from those three?

You mean during initial installation/setup or during an interactive run of dietpi-backup?

I mean during an initial installation from SD with a fresh DietPi, with an attached USB external unit with many backups already on it, without the use of any screen, with “AUTO_SETUP_BACKUP_RESTORE=2” on the “/boot/dietpi.txt” file.

DietPi will automatically restore the backup without any command from the user and it will choose the LAST backup it found on the external USB unit?

https://dietpi.com/docs/releases/v7_0/

All attached drives are mounted temporarily and searched automatically. Set
AUTO_SETUP_BACKUP_RESTORE=2
to have the first found backup restored non-interactively (this works in combination with AUTO_SETUP_AUTOMATED=1).

Also dietpi.txt says that.
In dietpi-software, around line 14400, we see how it determines the first found backup:

G_DIETPI-NOTIFY 2 'Searching all drives for DietPi-Backup instances...'
			mapfile -t alist < <(find /mnt -type f -name '.dietpi-backup_stats')

It creates a map (kinda a list) of all found backups and for option -2 it will use the first in the list.

All external drives are getting temporarily mounted for the automated restore:

# Mount drives to temporary mount points
				mkdir -p "/mnt/dietpi-backup$i" && mount "$line" "/mnt/dietpi-backup$i"
				((i++))

So if they are on the same drive and it’s the only one connected, I guess the path name decides then which one is picked?!