D-T
D-T

Reputation: 155

Create Moodle Curses via Cron-Jobe

is it possible to create moodle-corses with help of cron-job?

I need a process which read all 10 Minutes a csv-file into the moodle-system.

Thx for help :o)

D-T

Upvotes: 0

Views: 81

Answers (1)

Russell England
Russell England

Reputation: 10241

You can use this command line tool to upload courses

Execute Course Upload.

Options:
-h, --help                 Print out this help
-m, --mode                 Import mode: createnew, createall, createorupdate, update
-u, --updatemode           Update mode: nothing, dataonly, dataordefaults¸ missingonly
-f, --file                 CSV file
-d, --delimiter            CSV delimiter: colon, semicolon, tab, cfg, comma
-e, --encoding             CSV file encoding: utf8, ... etc
-t, --templatecourse       Shortname of the course to restore after import
-r, --restorefile          Backup file to restore after import
--reset                    Run the course reset after each course import
--allowdeletes             Allow courses to be deleted
--allowrenames             Allow courses to be renamed
--allowresets              Allow courses to be reset
--shortnametemplate        Template to generate the shortname from
--category                 ID of default category (--updatemode dataordefaults will use this value)


Example:
$sudo -u www-data /usr/bin/php admin/tool/uploadcourse/cli/uploadcourse.php --mode=createnew \
       --updatemode=dataonly --file=./courses.csv --delimiter=comma

See https://docs.moodle.org/310/en/Upload_courses

Upvotes: 1

Related Questions