Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: backup only when course hasn't changed #462

Open
Richardvi opened this issue Feb 9, 2024 · 8 comments
Open

Feature request: backup only when course hasn't changed #462

Richardvi opened this issue Feb 9, 2024 · 8 comments

Comments

@Richardvi
Copy link

Feature request for Moosh :)

We are using Moosh to backup our courses in Moodle. However, we need to do a full backup of all courses every night. It would be so useful if we could set this like in Moodle, to only create backups if the course has changed since last backup (or: since X days)

Hope this will be possible in a future version!

Thanks for your excellent work,

Richard.

@tmuras
Copy link
Owner

tmuras commented Feb 18, 2024

Very interesting idea. It could be implemented as a separate command so it could be used in other context.
Something like:
moosh course-changed 7 --since=1d

Practically it will be difficult to do it reliably - as each plugin may cause some change in the course. We could try to do it less-reliably, ie by reviewing course logs (was there any change there). I'm not sure if that would capture everything - it may be worth testing.

If you can come up with a list of checks that such a command should do, then I could perhaps implement it.

@Richardvi
Copy link
Author

I was also thinking about the logs of that course, but I can tell you now that our logs are HUGE.

I don't know if there's another way to check if a course has been altered. If we do a full backup, we also need to check the uploads in assignments of students for example.

Probably the only reliable way is to check the 'participants last visited course'. If no one has visited the course the last 24 hours, a daily backup is not needed.

@tmuras
Copy link
Owner

tmuras commented Mar 18, 2024

So maybe
moosh last-visited 7
where 7 is a course ID. That would return the number of hours since the course was last visited.
Would you then be able to script around it and get what you need?

@Richardvi
Copy link
Author

Absolutely, that would be awesome. We are now running a full backup of all 18k courses, which takes 96 hours. If we could filter the courses that are not changed, we could speed up the process and in case of emergency have a more recent backup available.

Thanks!

@tmuras
Copy link
Owner

tmuras commented Mar 22, 2024

Hi !

How about a deal? I will write the new command and you'll let us all know how do you use it.
Ie you will create a (written) section for the website:
https://moosh-online.com/tutorials (source: https://github.com/tmuras/moosh/blob/master/www/tutorials/index.md )
about how can those commands be used for course backup.

Have a nice day :)

@Richardvi
Copy link
Author

YES, deal accepted!

Our server admin can report on how he no longer uses Moodle's autobackup feature, but how Moosh will be used, what the beneftis are, etc. I can even ask him to share some of the scripts he uses to autobackup our entire Moodle site nightly (which has around 18.000 courses I think)

We have a fabulous use-case I think which can support many others.

@tmuras
Copy link
Owner

tmuras commented Mar 23, 2024

All right so!
Could you please install new version 1.19 and check this one:
https://moosh-online.com/commands/#course-last-visited

@Richardvi
Copy link
Author

I have not forgotten you, just got sick. I will still pick this up, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants