I’ve wrote a tool for grist backups:
https://community.getgrist.com/t/small-stand-alone-application-for-periodially-grist-backups-sqlite-xlsx-csv
this might be what you’re looking for.