OS: Debian Trixie
Version of Local: Version 9.2.9+6887
No multisite setup or custom configuration or any complex configuration.
My use-case is straight-forward. I am experimenting with a lot of plugins and don’t want to remember to take backups manually. So, want to setup a cron job for doing the same.
I also figured out the permission denied issue. I was directly running wp-cli without setting up the environment. These threads helped fix the issue: WP-CLI support with MySQL sockets in Local 5 - #4 by henscu and Open site shell not working (the latter issue should actually be filed as a bug).
What would be ideal is a script which takes just two arguments - 1. Local Site name / path and 2. Destination zip file path. It should then do the export and create the zip file. This should also be robust enough that if we delete the existing site and restore one from the backup, it should still work (because the site name / path would not have changed).