Automated backups: Maximum number of backups kept

Automated backups: Maximum number of backups kept

by Marius S -
Number of replies: 4

Hello,

we are running Moodle 3.7.

In Automated backup setup we have dropdown menu (Maximum number of backups kept) with these standard options:
All,1,2,5,10,20,30,40,50...

We chosen to keep 5 backups from this dropdown menu.

However I would like to ask if it's possible somehow to set to keep 4 backups?
Maybe we can set it in config.php file or database?

Thanks,
Marius.

Average of ratings: -
In reply to Marius S

Re: Automated backups: Maximum number of backups kept

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi Marius,

You should be able to specify that in config.php file, with a $CFG->forced_plugin_settings line. Check config-dist.php to know how to specify it exactly.

HTH,
Séverin
Average of ratings: Useful (1)
In reply to Séverin Terrier

Re: Automated backups: Maximum number of backups kept

by Marius S -
Hello Severin,

So basically the line should be: $CFG->forced_plugin_settings = array('backup' => array('backup_auto_max_kept' => 4));

However adding this in config.php and checking Automated backup setup page in Moodle it shows:
Maximum number of backups kept
Defined in config.php
Invalid current value: 4
backup | backup_auto_max_kept

Also I found this old comment (by Mark van Hoek) in Tracker: https://tracker.moodle.org/browse/MDL-61606?focusedCommentId=542345&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-542345

So adding value 3 or 4 will not work because they are not in within the range of this dropdown options (1,2,5,10,20...)?

Thanks,
Marius.
In reply to Marius S

Re: Automated backups: Maximum number of backups kept

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi Marius,

You're right for the line to insert in config.php.

And then, the "Invalid current value" message indicates that the value is "incorrect", because it doesn't comply to (pre-defined) "possible" values.

But it's enforced in config.php, and technically respected/used.

I have defined the number of days to retain logs to 720 days for years, and it works!

HTH,
Séverin
Average of ratings: Useful (1)
In reply to Séverin Terrier

Re: Automated backups: Maximum number of backups kept

by Marius S -
Thank you Severin, it works!
I have set to 4 and it keeps 4 weekly backups.