Automated backups: minimum and maximum amout of backups

Automated backups: minimum and maximum amout of backups

by Anton Tremetzberger -
Number of replies: 7
Picture of Particularly helpful Moodlers

Dear Community,

we are using automated backups in our Moodle 3.9. I'm still unclear about some of the settings: we would like to make max. 5 backups of each course. The minimum amount of backups of each course should be 2. Course backups which are older than 10 days should be deleted automatically. The settings will be:

    backup | backup_auto_max_kept = 5
    backup | backup_auto_delete_days = 10 days
    backup | backup_auto_min_kept = 2

In my opinion this setting will do following:

  • there will be stored max. 5 backups of "active" courses --> this works fine.
  • if the course will be less active (maybe course will be closed), course backups older than 10 days will be deleted and at the end only 2 course backups will be kept --> now I have noticed that these old backup files of less/not active courses will not be deleted.

I'm not shure how to understand the settings of auto_delete_days/auto_min_kept. But is there any possibility to manage automated backups as described above?

thanks, br Anton

Average of ratings: -
In reply to Anton Tremetzberger

Re: Automated backups: minimum and maximum amout of backups

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

I understand things like you.

What do you mean exactly by "now I have noticed that these old backup files of less/not active courses will not be deleted" ?

If you mean the last 2 backups, it's the aim. If you mean the (possibly) 3 olders, they should be deleted in my opinion (isn't that the case?). Do you still have cron running on your Moodle?

Séverin
In reply to Séverin Terrier

Re: Automated backups: minimum and maximum amout of backups

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Dear Séverin,

thank you for yor answer.

"now I have noticed that these old backup files of less/not active courses will not be deleted"
--> We have several old courses which are not beeing edited since weeks/months. There exists more than 2 course backups (eg 3, 4 or 5 files). Normally there should exist only 2 backup files.

"If you mean the last 2 backups, it's the aim. If you mean the (possibly) 3 olders, they should be deleted in my opinion (isn't that the case?). Do you still have cron running on your Moodle?"
--> Yes, older courses should be deleted, but it isn't the case.
CRON is running, course backups will be done every time the course backup is running.

Maybe it depends on further settings which we have set?
backup | backup_auto_skip_modif_days = never
backup | backup_auto_skip_modif_prev = YES

br, Anton
In reply to Anton Tremetzberger

Re: Automated backups: minimum and maximum amout of backups

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

All backup_auto_skip_xxx variables will determine if backup course must be done (or not). But it won't have affect to clear older backups.

Are your older backups more than 10 days (backup_auto_delete_days) ? I'm not sure which setting determines first what to delete...

Do you have good permissions on files, so that Moodle is able to delete old backups?

Séverin
In reply to Séverin Terrier

Re: Automated backups: minimum and maximum amout of backups

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Hi Séverin,

Most of the backups are older than 10 days.

thanks for the hint regarding the permissions. I have also read some hints about permission issues with "backup_auto_storage" (setting: specified directory for automated backups) and "backup_auto_destination" on external storages (eg Linux mounts) --> sometimes wrong permissions and changing storage directory will cause some problems with backup.

Our backups will be saved with a specific root-user (maybe because the root user will start the cron job), maybe Moodle try to delete the older files via webserver-user?

I will check these things together with our sysadmin and will do some tests in the next days. I will post my results here.

best regards
Anton
In reply to Séverin Terrier

Re: Automated backups: minimum and maximum amout of backups

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Dear Séverin,

I did some tests and now it works. But I'm not shure why it works, here are my ideas:

First: I checked CRON job and permissions: settings are correct

Second: I set: backup | backup_auto_skip_modif_prev = NO (originally we set it to YES).
So, every course will be checked and a backup will be done on the first backup process. After that the course backup process ran every night and older course backups was deleted. After the first run of the backup process I set: backup | backup_auto_skip_modif_prev = YES - and it also works fine. Older backups will be deleted.

Summary:
  • maybe the backup process have to run first time with all courses (set: backup | backup_auto_skip_modif_prev = NO)
  • I think it maybe also depends on how old the backup files are. We have coursebackups which will be stored a few months ago. Maybe Moodle will not consider about these old files? There is also a backup setting: backup | loglifetime = 30 days. Maybe the loglifetime-setting plays a role. If backups are older than 30 days they will not be considered and Moodle will not delete these files.
But it's just a guess - I hope that older course backups will now be deleted, but let me see after 30 days lächelnd.

br, Anton
In reply to Anton Tremetzberger

Re: Automated backups: minimum and maximum amout of backups

by Luis de Vasconcelos -
Hi Anton. So what happened after those 30 days? Did the old backups get deleted?
In reply to Luis de Vasconcelos

Re: Automated backups: minimum and maximum amout of backups

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers
Dear Luis,
yes, we checked it - the old backup files will be deleted after 30 days.
BR Anton
Average of ratings:Useful (1)