I have a Phoenix app. What’s the best way to do daily pgsql db backups?
Cron and a simple, separate elixir script which uploads a backup to AWS?
Create an api endpoint in my api which will require “SECRET” header and call it from cron? My webapp then will upload a backup to AWS, that is, there’ll be no separate elixir script.
Not sure why you’d need to do this specifically in the application/elixir/phonenix, unless you need to maintain some kind of meta data, or want to provide some kind of in-app restore functionality? Maybe this is my curmudgeonly sysadmin brain, but I’d probably just do this entirely out of the application and deal with it in at the system level. i.e. If I had a full backup solution already, I’d be using that. If I didn’t, I’d probably be scripting something up using pgdump and cron
I agree. This is really a database management issue and not an application issue. As far as the “best” way that depends on needs. I have found the officially provided bash scripts from Postgres to be very helpful.