15
15
along with this program; if not, write to the Free Software
16
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
.. _ref-admin-scripts:
24
IVLE has a number of admin scripts for uncommon configuration or other
25
functionality not available in the web application.
27
Most of these scripts must be run as root.
32
.. program:: ivle-addexercise
34
:program:`ivle-addexercise <EXERCISE>`
36
Adds an XML encoded exercise to the IVLE database. This is primarily
37
for importing exercises that pre-date the database storage system.
39
The exercise's name will be set to the complete path specified on the
40
command line -- keep this in mind when choosing a working directory.
42
.. cmdoption:: <EXERCISE>
44
The XML file containing the exercise to be uploaded.
49
.. program:: ivle-adduser
51
:program:`ivle-adduser [OPTIONS] <LOGIN> <FULLNAME>`
53
Creates a new user in the database. On-disk structures (jails and
54
Subversion repositories) will be created upon first login.
57
Admins may create users from the Users page of the web interface.
59
.. cmdoption:: <LOGIN>
61
Login name of the new user
63
.. cmdoption:: <FULLNAME>
67
.. cmdoption:: -p <PASSWORD>, --password <PASSWORD>
69
Cleartext password. If omitted, external authentication mechanisms
72
.. cmdoption:: -n <NICK>, --nick <NICK>
74
Display name (defaults to <FULLNAME>)
76
.. cmdoption:: -e <EMAIL>, --email <EMAIL>
80
.. cmdoption:: -s <SID>, --studentid <SID>
84
.. cmdoption:: --admin
86
Give the user global IVLE administrative privileges
92
.. program:: ivle-buildjail
94
:program:`ivle-buildjail [OPTIONS]`
96
Creates or updates the IVLE jail template.
98
.. cmdoption:: -r, --recreate
100
Completely recreate the jail - don't just update its IVLE code.
104
This may download hundreds of megabytes from the location specified by
107
.. cmdoption:: -u, --upgrade
109
Apply any package updates in the jail.
111
.. cmdoption:: -m <MIRROR>, --mirror <MIRROR>
113
Sets the APT mirror. May also be specified in the ``jail/mirror``
120
.. program:: ivle-cloneworksheets
122
:program:`ivle-cloneworksheets <OLDSUBJECTCODE> <OLDYEAR> <OLDSEMESTER>
123
<NEWSUBJECTCODE> <NEWYEAR> <NEWSEMESTER>`
125
Populates the offering specified by ``<NEWSUBJECTCODE> <NEWYEAR>
126
<NEWSEMESTER>`` with a copy of the worksheets from the offering specified by
127
``<OLDSUBJECTCODE> <OLDYEAR> <OLDSEMESTER>``.
130
Admins may also clone worksheets from the offering administration panel
131
in the web interface.
137
.. program:: ivle-config
139
:program:`ivle-config [ARG1] [ARG2] ...`
141
Configures IVLE with machine-specific details, most notably various paths.
142
Either prompts the administrator for these details or accepts them as
143
command line arguments.
145
Command line arguments may be any of the :ref:`configuration option
146
<ref-configuration-options>` used in :file:`ivle.conf`. They are provided in
147
the form of :samp:`--{section}/{subsection}/{property} {VALUE}` such as
148
``--urls/root ivle.org`` or ``--media/externals/jquery
149
/usr/share/javascript/jquery``.
151
Creates or updates :file:`/etc/ivle/ivle.conf` with the selected values,
152
and overwrites :file:`/etc/ivle/plugins.d/000default` with the latest
159
.. program:: ivle-createdatadirs
161
:program:`ivle-createdatadirs`
163
Creates the IVLE data hierarchy (by default under :file:`/var/lib/ivle`) if
164
it does not already exist.
170
.. program:: ivle-enrol
172
:program:`ivle-enrol <LOGIN> <SUBJECTCODE> <YEAR> <SEMESTER> [ROLE]`
174
Enrols a user in an offering.
177
Users may also be enrolled from the offering administration panel
178
in the web interface.
180
.. cmdoption:: <LOGIN>
182
Login of the user to enrol
184
.. cmdoption:: <SUBJECTCODE>
188
.. cmdoption:: <YEAR>
192
.. cmdoption:: <SEMESTER>
196
.. cmdoption:: [ROLE]
198
Role of the user. Should be one of 'student' (default), 'tutor' or
205
.. program:: ivle-enrolallusers
207
:program:`ivle-enrolallusers`
209
Adds enrolments for all users on the system.
210
Pulls from the configured :ref:`subject pulldown module
211
<ref-subject-pulldown-modules>` the subjects each student
212
is enrolled in, and adds enrolments to the database.
213
Does not remove any enrolments.
216
Pulldown modules are consulted for each user each time they log in,
217
so use of this script may not be required.
219
.. cmdoption:: -u <LOGIN>, --user <LOGIN>
221
Just perform enrolment for user ``<LOGIN>``
223
.. cmdoption:: -v, --verbose
225
Print out the details of each enrolment.
228
ivle-fetchsubmissions
229
---------------------
231
.. program:: ivle-fetchsubmissions
233
:program:`ivle-fetchsubmissions [OPTIONS] <SUBJECT> <PROJECT>`
235
Retrieves all submissions for a given project. Places each submission in its
236
own subdirectory of the current directory. Any errors are reported to stderr
237
(otherwise is silent).
240
Since this script accesses Subversion repositories through the
241
filesystem, it must be run on the master server.
243
.. cmdoption:: <SUBJECT>
245
Subject short (URL) name
247
.. cmdoption:: <PROJECTNAME>
249
Project short (URL) name
251
.. cmdoption:: -s <SEMESTER>, --semester <SEMESTER>
253
Semester of the offering (eg. 2009/1). Defaults to the currently
256
.. cmdoption:: -d <PATH>, --dest <PATH>
258
Destination directory (defaults to the current directory) in
259
which to place submissions. Will create subdirectories in this
260
directory of the form ``subject/year/semester/project``.
262
.. cmdoption:: -z, --zip
264
Store each submission in a Zip file.
266
.. cmdoption:: -v, --verbose
268
Print the name of each submission as it is extracted.
270
.. cmdoption:: --no-txt
272
Disable writing a text file with metadata about each submission.
278
.. program:: ivle-listusers
280
:program:`ivle-listusers [OPTIONS]`
282
Lists all users in the IVLE database.
285
Users may also be listed and administered through the web interface,
286
from the *Users* item in the IVLE menu.
288
.. cmdoption:: -n, --names
290
Print only each user's login name
296
.. program:: ivle-mountallusers
298
:program:`ivle-mountallusers`
300
Attempts to mount the jails of all users.
304
Administrators should not need to manually run this script for regular
305
operation. IVLE will automatically mount users' jails on demand.
307
.. cmdoption:: -v, --verbose
309
Print a message for each mount or unmount.
311
.. cmdoption:: -u, --unmount
313
Unmount jails instead of mounting them.
316
ivle-refreshfilesystem
317
----------------------
319
.. program:: ivle-refreshfilesystem
321
:program:`ivle-refreshfilesystem`
323
Refresh parts of the filesystem to match the database.
326
- all jails are rebuilt
327
- missing user jails are created
328
- missing user and group Subversion repositories are created
329
- jails for missing users are removed
330
- Subversion repositories for missing users or groups are removed
331
- the Subversion password file is updated
332
- the Subversion authorisation files are rewritten
335
Due to the full jail rebuilds, existing jail mounts may be broken
336
after this script has run. To recover from this situation, use
337
``ivle-mountallusers`` to unmount all of the jails.
340
Jails and Subversion repositories are not entirely removed. They
341
can be found in a timestamped directory alongside their parent.
347
.. program:: ivle-remakeuser
349
:program:`ivle-remakeuser [OPTIONS] <USER>`
351
:program:`ivle-remakeuser [OPTIONS] -a`
353
Rebuilds the jail of a single user or of all users in IVLE. This will
354
retain all user data, but recreate the rest of the hierarchy and
355
internal configuration files.
357
.. cmdoption:: <USER>
359
Login of the user whose jail should be rebuilt
361
.. cmdoption:: -a, --all
363
Rebuild the jail of every user
365
.. cmdoption:: -v, --verbose
367
Print a message as each user's jail is remade
373
.. program:: ivle-showenrolment
375
:program:`ivle-showenrolment <USER>`
377
Shows the enrolments of a user. Prints subject code, subject name, year,
378
semester and the held role for each subject in which they are enrolled.
380
.. cmdoption:: <USER>