dbsaver icon indicating copy to clipboard operation
dbsaver copied to clipboard

[Feature] Add an option for backups periodicity

Open bastien70 opened this issue 2 years ago • 2 comments

Perhaps users would like one database to be backed up every week, and another every day or month.

Currently, the user himself configures a single CRON task with a certain periodicity which will be the same for all databases.

Instead, we could indicate to the user to configure a CRON task which will be executed every day and which will check if there are databases to backup, according to the requested periodicity.

bastien70 avatar Jul 26 '22 11:07 bastien70

Maybe guikingone/scheduler-bundle would be an option? Or zenstruck's one

jmsche avatar Jul 26 '22 12:07 jmsche

Mmh I'm not sure it's necessarily useful in our case, is it? It would be extra work for nothing.

In bundles of this kind, we can certainly define several CRON tasks and then in the end declare only one "real" CRON task at the server level, which would be executed for example every minute.

But it's the same as what I had proposed above, namely running a CRON task every hour for example, which would check if databases should be backed up, and if so, do so.

It is enough simply to add to Database entity the property "periodicity" (and why not "nextBackupDate") and a simple condition at the command level.

bastien70 avatar Jul 26 '22 12:07 bastien70