Auto restoring a course on a schedule

Auto restoring a course on a schedule

by Blair F. -
Number of replies: 4
Picture of Particularly helpful Moodlers
I know there's a way to auto-restore a course on a schedule, but no matter what search terms I use I cannot find anything about it. 

I'm referring to the situation where you have a sample course for people to play around with and then it returns to it's original state on a schedule (like very hour, for example).

Can someone point me in the right direction?

Thanks!

Average of ratings: -
In reply to Blair F.

Re: Auto restoring a course on a schedule

by Ken Task -
Picture of Particularly helpful Moodlers
If you are talking about an existing plugin that does as described, haven't seen one ... but ...

a shell script using moosh commands

moosh course-delete 2 (where 2 is the course id number)

Then another moosh command:

course-restore
Restore course from path/to/backup.mbz to category or existig course.

Example 1: Restore backup.mbz into category with id=1
moosh course-restore backup.mbz 1

Example 2: Restore backup.mbz into existing course with id=3
moosh course-restore -e backup.mbz 3

Example 3: Ignore pre-check warnings, like restoring backup from higher Moodle version.
moosh course-restore --ignore-warnings backup.mbz 1

Example 4: Restore backup.mbz into existing course with id=3, overwrite course content.
moosh course-restore --overwrite backup.mbz 3

Category called "Tinker" (or whatever) - has no other courses in it.

There is a potential catch 22 ... recycle bin.  Depending upon site factors, a little stress there if course is large or is made huge by tinkering and your server is in a space crunch.

'SoS', Ken
In reply to Ken Task

Re: Auto restoring a course on a schedule

by Blair F. -
Picture of Particularly helpful Moodlers
Thanks, Ken, but I was thinking I'd come across something that did it on a schedule within Moodle. I don't use Moosh for anything. Maybe I dreamt it.