Need of Automatic Backups in Listmonk CLI
Is your feature request related to a problem? Please describe.
The problem is with Listmonk not having automated backups. I usually take backups with pg_dump which is insanely simple.
Describe the solution you'd like
Utilizing go to write a command line tool for listmonk which include a bunch of stuff including backups in it would be a good decision and thing to work on. Or this could be inbuilt inside the listmonk binary itself with a ./listmonk --backup itself ?
I would definitely use it if it existed but I feel like data retention/preservation policies are unique depending on each use case. Like you said you can select which properties you would like and just do your pg_dump as a cronjob/task in your server.
pg_dump is the safest and simplest way to backup indeed. Guaranteed to export the DB state as-is.
A built-in function would indeed be more convenient but that will involve trying to rebuild pg_dump inside listmonk. I’ll evaluate this nonetheless.
There is no straightforward way of doing this from within the app. The best way is to backup using native tools such as pg_dump, although it's not as convenient as having an option directly within the app.
Yes, I had noticed this already while I was working on taking the backup last year. A simple function call and use of flag in the listmonk binary should do good.
I will try working on this today, haven't worked with go in any previous projects though, would love to give a try.
I had a query, is it mandatory to setup an instance to test or there are alternative ways of testing it ?
Edit: figured it out, and running a demo instance in local
@knadh could you please assign this issue to me ?
Hi @Mangeshrex. If the idea is to execute pg_dump from within the binary, that will not work in most environments, especially Docker. In most production setups, there is no guarantee that pg_dump would be installed and available in the same environment as the listmonk binary.
It won't be possible even if we add validations and checks to see if pg_dump is installed in that particular environment ? But i'm guessing pg_dump would become another dependency
We can check for the presence of pg_dump, but it won't be a universal for backups. It'll be an option that works in some environments and not in most, where we'll have to display a message saying ~ "Use pg_dump externally to take backups". Unsure of if we should ship a feature with uncertainty. It won't be good UX.
Agreed @knadh. Leaving the decision up to you. Please close the issue once you're sure that this is an unnecessary feature which does no good.