>so there is no way to automatically backup the bookmarks in this nice format
Firefox automatically backs up current bookmarks in lz4-compressed json under $profiledir/bookmarkbackups ($profiledir by default being like ~/.mozilla/firefox/xxxx.default). Can also autoexport to an HTML file by setting the following about:config prefs:
browser.bookmarks.autoExportHTML => (boolean) true
browser.bookmarks.file => (string) "/home/user/bookmarks.html"
If later pref is omitted then file will be $profiledir/bookmarks.html.An issue with depending on this functionality is the backup happens when closing the browser.