How To Calculate The Oldest Index Efficiently?

(duplicati-2.0.6.3-2.0.6.3_beta_20210617.noarch.rpm on Fedora 35)

In my bash script for the local duplicati backup with the CLI variant, I sometimes need to know the number of the oldest index.

I can get that number via the duplicati “find” command and extract that number in the last line in its stdout. So far so good. But for me it often takes 10 to 30 minutes until duplicati can display that number.

On the other hand, in the directory of the backup disk I see the .dlist.zip files. So I could do "ls /backup-dir/.dlist.zip | wc -l" and subtract 1 to get the number of the oldest index within a millisecond.

Questions: Is this method always reliable? Or is it better to always rely on the duplicati-find command? Or can duplicati display the number of the oldest index in a different and faster way?

Yes, I think there is always a 1:1 ratio of backup versions to dlist files. The only time I can think this may not be true is when the local database and back end are out of sync for some reason. If that happens Duplicati would complain at the start of the next backup and ask for a repair operation.

You’re not kidding. Using “find” to show you the version list takes forever!