Bash Command Line Scripts for Moodle

bashmdlscripts

above linked to bashmdlscripts.zip

Contained in the zip:

checkvars – checks if you have filled in variables in mdlvars.txt
dobu – backs up one course
getcids – gets course ids to use with dobu
getcourses – gets a courses.txt file that list courses by id/shortname/longname
mdlvars.txt – set variables for these scripts
niclbackups – non interactive command line backups
sbackupcode – all the s- scripts use mdlvars.txt file for variables. backup for code
sbackupdata – backup data
sbackupdb – backup database

To use these, first upload the zip to /path/to/your/moodle/code/admin/cli/
Unzip the zip there.

Strongly suggest you open with text editor and inspect each or at least ‘cat’ them to view contents.
Example: cat dobu

* Edit the mdlvars.txt file providing the variables first

** Backup directories must be created manually … these scripts will not create them
for you.

Offered as is … no support will be provided.

‘in the spirit of sharing’ …

Leave a Reply