none
[openafs-wiki.git] / TWiki / TWikiScripts.mdwn
1 # <a name="TWiki CGI and Command Line Scrip"></a> TWiki CGI and Command Line Scripts
2
3 _Programs on the TWiki server performing actions such as rendering, saving and renaming topics._
4
5 The TWiki scripts are located in the `twiki/bin` and `twiki/tools` directories. This topic describes the interfaces to some of those scripts. All scripts in the `twiki/bin` directory can be called from the CGI ([Common Gateway Interface](http://en.wikipedia.org/wiki/Common_Gateway_Interface)) environment or from the command line. The scripts in the `twiki/tools` directory can only be called from the command line.
6
7 <div>
8   <ul>
9     <li><a href="#TWiki CGI and Command Line Scrip"> TWiki CGI and Command Line Scripts</a><ul>
10         <li><a href="#CGI Scripts"> CGI Scripts</a><ul>
11             <li><a href="#General Information"> General Information</a><ul>
12                 <li><a href="#CGI environment"> CGI environment</a></li>
13                 <li><a href="#Command-line"> Command-line</a></li>
14                 <li><a href="#Common parameters"> Common parameters</a></li>
15               </ul>
16             </li>
17             <li><a href="#=attach="> attach</a></li>
18             <li><a href="#=changes="> changes</a></li>
19             <li><a href="#=configure="> configure</a></li>
20             <li><a href="#=edit="> edit</a></li>
21             <li><a href="#=login="> login</a></li>
22             <li><a href="#=logon="> logon</a></li>
23             <li><a href="#=manage="> manage</a><ul>
24                 <li><a href="#=action=createweb="> action=createweb</a></li>
25                 <li><a href="#=action=editSettings="> action=editSettings</a></li>
26                 <li><a href="#=action=saveSettings="> action=saveSettings</a></li>
27                 <li><a href="#=action=bulkRegister="> action=bulkRegister</a></li>
28                 <li><a href="#=action=changePassword="> action=changePassword</a></li>
29                 <li><a href="#=action=resetPassword="> action=resetPassword</a></li>
30                 <li><a href="#=action=delete_UserAccount="> action=deleteUserAccount</a></li>
31               </ul>
32             </li>
33             <li><a href="#=oops="> oops</a></li>
34             <li><a href="#=preview="> preview</a></li>
35             <li><a href="#=rdiff="> rdiff</a></li>
36             <li><a href="#=register="> register</a></li>
37             <li><a href="#=rename="> rename</a></li>
38             <li><a href="#=rest="> rest</a><ul>
39                 <li><a href="#Invocation Examples"> Invocation Examples</a></li>
40               </ul>
41             </li>
42             <li><a href="#=save="> save</a></li>
43             <li><a href="#=search="> search</a></li>
44             <li><a href="#=statistics="> statistics</a></li>
45             <li><a href="#=upload="> upload</a></li>
46             <li><a href="#=view="> view</a></li>
47             <li><a href="#=viewfile="> viewfile</a></li>
48           </ul>
49         </li>
50         <li><a href="#Command Line Scripts"> Command Line Scripts</a><ul>
51             <li><a href="#=geturl.pl="> geturl.pl</a></li>
52             <li><a href="#=rewriteshebang.pl="> rewriteshebang.pl</a></li>
53             <li><a href="#=tick_twiki.pl="> tick_twiki.pl</a></li>
54           </ul>
55         </li>
56       </ul>
57     </li>
58   </ul>
59 </div>
60
61 ## <a name="CGI Scripts"></a> CGI Scripts
62
63 Details on CGI scripts located in the `twiki/bin` directory.
64
65 ### <a name="General Information"></a> General Information
66
67 #### <a name="CGI environment"></a> CGI environment
68
69 In the CGI environment parameters are passed to the scripts via the URL and URL parameters. Environment variables are also used to determine the user performing the action. If the environment is not set up, the default TWiki user is used (usually `guest`).
70
71 #### <a name="Command-line"></a> Command-line
72
73 You **must** be have the `twiki/bin` directory on the perl path to run the scripts from the command line. To avoid issues with file permissions, run the scripts as the web server user such as `nobody` or `www`.
74
75 Parameters are passed on the command line using '-name' - for example,
76
77     $ cd /usr/local/twiki/bin
78     $ save -topic MyWeb.MyTopic -user admin -action save -text "New text of the topic"
79
80 All parameters require a value, even if that is the empty string.
81
82 #### <a name="Common parameters"></a> Common parameters
83
84 All the scripts accept a number of common parameters. The first two components of the URL after the script name are taken as the web and the topic, respectively. Standard URL parameters are:
85
86 <table border="1" cellpadding="0" cellspacing="0">
87   <tr>
88     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
89     <th bgcolor="#99CCCC"><strong> Description </strong></th>
90     <th bgcolor="#99CCCC"><strong> Default </strong></th>
91   </tr>
92   <tr>
93     <td><code>topic</code></td>
94     <td> If this is set to a URL, TWiki will immediately redirect to that URL. Otherwise it overrides the URL and is taken as the topic name (you can pass Web.TopicName) </td>
95     <td>   </td>
96   </tr>
97   <tr>
98     <td><code>user</code></td>
99     <td> Command-line only; set the name of the user performing the action. Note: this usage is inherently insecure, as it bypasses webserver login constraints. For this reason only authorised users should be allowed to execute scripts from the command line. </td>
100     <td>   </td>
101   </tr>
102   <tr>
103     <td><code>skin</code></td>
104     <td> Overrides the default skin path (see [[Main/TWikiSkins]]) </td>
105     <td>   </td>
106   </tr>
107   <tr>
108     <td><code>cover</code></td>
109     <td> Specifies temporary skin path to prepend to the skin path for this script only (see [[Main/TWikiSkins]]) </td>
110     <td>   </td>
111   </tr>
112 </table>
113
114 ### <a name="=attach="></a> `attach`
115
116 Despite the name, this script doesn't actually attach a file to a topic - for that, use `upload`. This script is part of the transactions sequence executed when a file is uploaded from the browser. it just generates the "new attachment" page for a topic.
117
118 <table border="1" cellpadding="0" cellspacing="0">
119   <tr>
120     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
121     <th bgcolor="#99CCCC"><strong> Description </strong></th>
122     <th bgcolor="#99CCCC"><strong> Default </strong></th>
123   </tr>
124   <tr>
125     <td><code>filename</code></td>
126     <td> Name of existing attachment (if provided, this is a "manage attachment" action) </td>
127     <td> none (in which case this is a "new attachment" action) </td>
128   </tr>
129 </table>
130
131 ### <a name="=changes="></a> `changes`
132
133 Shows all the changes in the given web.
134
135 The `changes` script can receive one parameter:
136
137 <table border="1" cellpadding="0" cellspacing="0">
138   <tr>
139     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
140     <th bgcolor="#99CCCC"><strong> Description </strong></th>
141     <th bgcolor="#99CCCC"><strong> Default </strong></th>
142   </tr>
143   <tr>
144     <td><code>minor</code></td>
145     <td> If 0, show only major changes. If 1, show all the changes (both minor and major) </td>
146     <td> 0 </td>
147   </tr>
148 </table>
149
150 The main difference between invoking this script and using [[WebChanges]] is that [[WebChanges]] is based on a `%SEARCH%`, while this script reads the `changes` file in each web, making it much faster.
151
152 **NOTE**: The result from `changes` script and the topic [[WebChanges]] can be different, if the `changes` file is deleted from a web. In particular, in new installations the `changes` script will return no results while the [[WebChanges]] topic will.
153
154 ### <a name="=configure="></a> `configure`
155
156 `configure` is the browser script used for inspection and configuration of the TWiki configuration. None of the parameters to this script are useable for any purpose except `configure`. See [configure](http://www.dementia.org/twiki/configure).
157
158 ### <a name="=edit="></a> `edit`
159
160 The `edit` script understands the following parameters, typically supplied by HTML input fields:
161
162 <table border="1" cellpadding="0" cellspacing="0">
163   <tr>
164     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
165     <th bgcolor="#99CCCC"><strong> Description </strong></th>
166     <th bgcolor="#99CCCC"><strong> Default </strong></th>
167   </tr>
168   <tr>
169     <td><code>action</code></td>
170     <td> Optional. Use the editaction template instead of the standard edit. If action=text, then hide the form. If action=form hide the normal text area and only edit the form. You can change the Edit/Edit Raw buttons to always append the action parameter in skins like Pattern and Classic by setting the topic or preference variable [[Main/VarEDITACTION]] to the value <code>text</code> or <code>form</code>. To edit the topic once the EDITACTION is defined as form simply remove the action=form from the browser URL of the edit script and reload the edit window </td>
171     <td>   </td>
172   </tr>
173   <tr>
174     <td><code>onlynewtopic</code></td>
175     <td> If set, error if topic already exists </td>
176     <td>   </td>
177   </tr>
178   <tr>
179     <td><code>onlywikiname</code></td>
180     <td> If set, error if topic name is not a [[Main/WikiWord]]</td>
181     <td>   </td>
182   </tr>
183   <tr>
184     <td><code>templatetopic</code></td>
185     <td> The name of the template topic, copied to get the initial content (new topic <em>only</em>) </td>
186     <td>   </td>
187   </tr>
188   <tr>
189     <td><code>text</code></td>
190     <td> Initial text for the topic </td>
191     <td>   </td>
192   </tr>
193   <tr>
194     <td><code>topicparent</code></td>
195     <td> The parent topic </td>
196     <td>   </td>
197   </tr>
198   <tr>
199     <td><code>formtemplate</code></td>
200     <td> Name of the form to instantiate in the topic. Overrides the form set in the <code>templatetopic</code> if defined. (will remove the form is set to 'none') </td>
201     <td>   </td>
202   </tr>
203   <tr>
204     <td><code>contenttype</code></td>
205     <td> Optional parameter that defines the application type to write into the CGI header. Defaults to <code>text/html</code>. May be used to invoke alternative client applications </td>
206     <td>   </td>
207   </tr>
208   <tr>
209     <td><code>anyname</code></td>
210     <td> Any parameter can passed to the new topic; if the template topic contains <code>%URLPARAM{"anyname"}%</code>, it will be replaced by its value </td>
211     <td>   </td>
212   </tr>
213   <tr>
214     <td><code>breaklock</code></td>
215     <td> If set, any lease conflicts will be ignored, and the edit will proceed even if someone is already editing the topic. </td>
216     <td>   </td>
217   </tr>
218   <tr>
219     <td><code>redirectto</code></td>
220     <td> If the user continues from edit to save, and if the save (or cancels the edit) process is successful, save will redirect to this topic or URL. The parameter value can be a <code>TopicName</code>, a <code>Web.TopicName</code>, or a URL.%BR% <strong><em>Note:</em></strong> Redirect to a URL only works if it is enabled in <code>configure</code> (Miscellaneous <code>{AllowRedirectUrl}</code>). </td>
221     <td>   </td>
222   </tr>
223 </table>
224
225 Form field values are passed in parameters named 'field' - for example, if I have a field `Status` the parameter name is `Status`.
226
227 1. The first sequence of ten or more `X` characters in the topic name will be converted on save to a number such that the resulting topic name is unique in the target web.
228
229 NOTE: most skins support the definition of `EDIT_SKIN`, which is used as the value of the `cover` parameter in `edit` URLs. This allows you to override the default edit skin on a web, topic or user basis.
230
231 ### <a name="=login="></a> `login`
232
233 Used for logging in when TWiki login is being used (e.g TemplateLoginManager).
234
235 <table border="1" cellpadding="0" cellspacing="0">
236   <tr>
237     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
238     <th bgcolor="#99CCCC"><strong> Description </strong></th>
239     <th bgcolor="#99CCCC"><strong> Default </strong></th>
240   </tr>
241   <tr>
242     <td><code>origurl</code></td>
243     <td> URL that was being accessed when an access violation occurred. the login process will redirect to this URL if it is successful </td>
244     <td> none </td>
245   </tr>
246   <tr>
247     <td><code>username</code></td>
248     <td> username of user logging in </td>
249     <td> none </td>
250   </tr>
251   <tr>
252     <td><code>password</code></td>
253     <td> password of user logging in </td>
254     <td> none </td>
255   </tr>
256 </table>
257
258 ### <a name="=logon="></a> `logon`
259
260 Used for logging in when Web Server authentication is being used (e.g. ApacheLoginManager). The script does nothing; it is purely a placeholder for triggering the login process. The webserver will be set up to require a valid user to access this script, thus triggering the webserver login process.
261
262 ### <a name="=manage="></a> `manage`
263
264 Performs a range of management functions.
265
266 <table border="1" cellpadding="0" cellspacing="0">
267   <tr>
268     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
269     <th bgcolor="#99CCCC"><strong> Description </strong></th>
270     <th bgcolor="#99CCCC"><strong> Default </strong></th>
271   </tr>
272   <tr>
273     <td><code>action</code></td>
274     <td> One of <code>createweb</code>, <code>deleteUserAccount</code>, <code>editSettings</code> or <code>saveSettings</code></td>
275     <td> none </td>
276   </tr>
277 </table>
278
279 #### <a name="=action=createweb="></a> `action=createweb`
280
281 <table border="1" cellpadding="0" cellspacing="0">
282   <tr>
283     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
284     <th bgcolor="#99CCCC"><strong> Description </strong></th>
285     <th bgcolor="#99CCCC"><strong> Default </strong></th>
286   </tr>
287   <tr>
288     <td><code>newweb</code></td>
289     <td> Name of the new web </td>
290     <td> '' </td>
291   </tr>
292   <tr>
293     <td><code>baseweb</code></td>
294     <td> Name of the web to copy to create the new web </td>
295     <td> '' </td>
296   </tr>
297   <tr>
298     <td><code>webbgcolor</code></td>
299     <td> value for WEBBGCOLOR </td>
300     <td> '' </td>
301   </tr>
302   <tr>
303     <td><code>sitemapwhat</code></td>
304     <td> Value for SITEMAPWHAT </td>
305     <td> '' </td>
306   </tr>
307   <tr>
308     <td><code>sitemapuseto</code></td>
309     <td> Value for SITEMAPUSETO </td>
310     <td> '' </td>
311   </tr>
312   <tr>
313     <td><code>nosearchall</code></td>
314     <td> Value for NOSEARCHALL </td>
315     <td> '' </td>
316   </tr>
317 </table>
318
319 #### <a name="=action=editSettings="></a> `action=editSettings`
320
321 No parameters
322
323 #### <a name="=action=saveSettings="></a> `action=saveSettings`
324
325 <table border="1" cellpadding="0" cellspacing="0">
326   <tr>
327     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
328     <th bgcolor="#99CCCC"><strong> Description </strong></th>
329     <th bgcolor="#99CCCC"><strong> Default </strong></th>
330   </tr>
331   <tr>
332     <td><code>text</code></td>
333     <td> Text of the topic </td>
334     <td> '' </td>
335   </tr>
336   <tr>
337     <td><code>originalrev</code></td>
338     <td> Revision that the edit started on </td>
339     <td> Most recent revision </td>
340   </tr>
341   <tr>
342     <td><code>redirectto</code></td>
343     <td> If the savesettings process is successful, save will redirect to this topic or URL. The parameter value can be a <code>TopicName</code>, a <code>Web.TopicName</code>, or a URL.%BR% <strong><em>Note:</em></strong> Redirect to a URL only works if it is enabled in <code>configure</code> (Miscellaneous <code>{AllowRedirectUrl}</code>). </td>
344   </tr>
345 </table>
346
347 All other parameters may be interpreted as form fields, depending on the current form definition in the topic.
348
349 #### <a name="=action=bulkRegister="></a> `action=bulkRegister`
350
351 See [[BulkRegistration]].
352
353 <table border="1" cellpadding="0" cellspacing="0">
354   <tr>
355     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
356     <th bgcolor="#99CCCC"><strong> Description </strong></th>
357     <th bgcolor="#99CCCC"><strong> Default </strong></th>
358   </tr>
359   <tr>
360     <td><code>OverwriteHomeTopics</code></td>
361     <td> Whether to overwrite existing home topics or not </td>
362     <td> false </td>
363   </tr>
364   <tr>
365     <td><code>EmailUsersWithDetails</code></td>
366     <td> Whether to mail registered users or not </td>
367     <td> false </td>
368   </tr>
369   <tr>
370     <td><code>LogTopic</code></td>
371     <td> Topic to save the log in </td>
372     <td> Same as topic name, with 'Result' appended. </td>
373   </tr>
374 </table>
375
376 #### <a name="=action=changePassword="></a> `action=changePassword`
377
378 Change password, email address, or both, of a user.
379
380 <table border="1" cellpadding="0" cellspacing="0">
381   <tr>
382     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
383     <th bgcolor="#99CCCC"><strong> Description </strong></th>
384     <th bgcolor="#99CCCC"><strong> Default </strong></th>
385   </tr>
386   <tr>
387     <td><code>username</code></td>
388     <td> god alone knows </td>
389     <td><em>none</em></td>
390   </tr>
391   <tr>
392     <td><code>oldpassword</code></td>
393     <td> current password </td>
394     <td><em>none</em></td>
395   </tr>
396   <tr>
397     <td><code>password</code></td>
398     <td> new password </td>
399     <td><em>none</em></td>
400   </tr>
401   <tr>
402     <td><code>passwordA</code></td>
403     <td> new password confirmation </td>
404     <td><em>none</em></td>
405   </tr>
406   <tr>
407     <td><code>email</code></td>
408     <td> new email address </td>
409     <td><em>none</em></td>
410   </tr>
411 </table>
412
413 `password, =passwordA` and `email` are optional. If neither or `password` and `passwordA` is set, then the user password is left unchanged. If `email` is unset, their email is left unchanged.
414
415 #### <a name="=action=resetPassword="></a> `action=resetPassword`
416
417 Reset the password for a single or multiple users
418
419 <table border="1" cellpadding="0" cellspacing="0">
420   <tr>
421     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
422     <th bgcolor="#99CCCC"><strong> Description </strong></th>
423     <th bgcolor="#99CCCC"><strong> Default </strong></th>
424   </tr>
425   <tr>
426     <td><code>LoginName</code></td>
427     <td><strong>list</strong> of usernames to reset </td>
428     <td> none - error if not set </td>
429   </tr>
430   <tr>
431     <td><code>Introduction</code></td>
432     <td> message to be sent alongside the reset, most often used to announce to the user that they have been given an account. </td>
433     <td> '' </td>
434   </tr>
435 </table>
436
437 This is used by [[BulkResetPassword]] and [[ResetPassword]]. Only administrators can provide a list of [[LoginNames]], non-admins can only provide a single [[LoginName]].
438
439 [[BulkRegistration]] provides the means to create multiple accounts but it does not announce those accounts to the users who own them. [[BulkResetPassword]] is used to assign the passwords, the Introduction is used to explain why they are receiving the mail.
440
441 #### <a name="=action=delete_UserAccount="></a> `action=deleteUserAccount`
442
443 Unregisters (removes) the currently logged-in user.
444
445 <table border="1" cellpadding="0" cellspacing="0">
446   <tr>
447     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
448     <th bgcolor="#99CCCC"><strong> Description </strong></th>
449     <th bgcolor="#99CCCC"><strong> Default </strong></th>
450   </tr>
451   <tr>
452     <td><code>password</code></td>
453     <td> Users' password </td>
454     <td> none </td>
455   </tr>
456 </table>
457
458 ### <a name="=oops="></a> `oops`
459
460 This script is mainly used for rendering pages containing error messages, though it is also used for some functional actions such as manage pages (move topic etc).
461
462 `oops` templates are used with the `oops` script to generate system messages. This is done to make internationalisation or other local customisations simple.
463
464 The `oops` script supports the following parameters:
465
466 <table border="1" cellpadding="0" cellspacing="0">
467   <tr>
468     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
469     <th bgcolor="#99CCCC"><strong> Description </strong></th>
470     <th bgcolor="#99CCCC"><strong> Default </strong></th>
471   </tr>
472   <tr>
473     <td><code>template</code></td>
474     <td> Name of the template file to display </td>
475     <td>   </td>
476   </tr>
477   <tr>
478     <td><code>def</code></td>
479     <td> Optional, can be set to the name of a single definition within <code>template</code>. This definition will be instantiated in the <code>template</code> wherever <code>%INSTANTIATE%</code> is seen. This lets you use a single template file for many messages. For an example, see <code>oopsmanagebad.tmpl</code>. </td>
480     <td>   </td>
481   </tr>
482   <tr>
483     <td><code>paramN</code></td>
484     <td> Where N is an integer from 1 upwards. These values will be substituted into <code>template</code> for <code>%PARAM1%</code> etc. </td>
485     <td>   </td>
486   </tr>
487 </table>
488
489 ### <a name="=preview="></a> `preview`
490
491 This script is _deprecated_. Its functions are covered by the `save` script.
492
493 ### <a name="=rdiff="></a> `rdiff`
494
495 Renders the differences between version of a TWiki topic
496
497 <table border="1" cellpadding="0" cellspacing="0">
498   <tr>
499     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
500     <th bgcolor="#99CCCC"><strong> Description </strong></th>
501     <th bgcolor="#99CCCC"><strong> Default </strong></th>
502   </tr>
503   <tr>
504     <td> rev1 </td>
505     <td> the higher revision </td>
506     <td>   </td>
507   </tr>
508   <tr>
509     <td> rev2 </td>
510     <td> the lower revision </td>
511     <td>   </td>
512   </tr>
513   <tr>
514     <td> render </td>
515     <td> the rendering style {sequential, sidebyside, raw, debug} </td>
516     <td> DIFFRENDERSTYLE, <code>sequential</code></td>
517   </tr>
518   <tr>
519     <td> type </td>
520     <td> {history, diff, last} history diff, version to version, last version to previous </td>
521     <td><code>diff</code></td>
522   </tr>
523   <tr>
524     <td> context </td>
525     <td> number of lines of context </td>
526     <td>   </td>
527   </tr>
528 </table>
529
530 TODO:
531
532 - add a \{word\} render style
533
534 ### <a name="=register="></a> `register`
535
536 <table border="1" cellpadding="0" cellspacing="0">
537   <tr>
538     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
539     <th bgcolor="#99CCCC"><strong> Description </strong></th>
540     <th bgcolor="#99CCCC"><strong> Default </strong></th>
541   </tr>
542   <tr>
543     <td><code>action</code></td>
544     <td><code>register</code> or <code>verify</code> or <code>resetPassword</code> or <code>approve</code></td>
545     <td>   </td>
546   </tr>
547 </table>
548
549 ### <a name="=rename="></a> `rename`
550
551 Used for renaming topics.
552
553 <table border="1" cellpadding="0" cellspacing="0">
554   <tr>
555     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
556     <th bgcolor="#99CCCC"><strong> Description </strong></th>
557     <th bgcolor="#99CCCC"><strong> Default </strong></th>
558   </tr>
559   <tr>
560     <td><code>skin</code></td>
561     <td> skin(s) to use </td>
562     <td>   </td>
563   </tr>
564   <tr>
565     <td><code>newweb</code></td>
566     <td> new web name </td>
567     <td>   </td>
568   </tr>
569   <tr>
570     <td><code>newtopic</code></td>
571     <td> new topic name </td>
572     <td>   </td>
573   </tr>
574   <tr>
575     <td><code>breaklock</code></td>
576     <td>   </td>
577     <td>   </td>
578   </tr>
579   <tr>
580     <td><code>attachment</code></td>
581     <td>   </td>
582     <td>   </td>
583   </tr>
584   <tr>
585     <td><code>confirm</code></td>
586     <td> if defined, requires a second level of confirmation </td>
587     <td>   </td>
588   </tr>
589   <tr>
590     <td><code>currentwebonly</code></td>
591     <td> if defined, searches current web only for links to this topic </td>
592     <td>   </td>
593   </tr>
594   <tr>
595     <td><code>nonwikiword</code></td>
596     <td> if defined, a non-wikiword is acceptable for the new topic name </td>
597     <td>   </td>
598   </tr>
599   <tr>
600     <td><code>redirectto</code></td>
601     <td> If the rename process is successful, rename will redirect to this topic or URL. The parameter value can be a <code>TopicName</code>, a <code>Web.TopicName</code>, or a URL.%BR% <strong><em>Note:</em></strong> Redirect to a URL only works if it is enabled in <code>configure</code> (Miscellaneous <code>{AllowRedirectUrl}</code>). </td>
602     <td>   </td>
603   </tr>
604 </table>
605
606 ### <a name="=rest="></a> `rest`
607
608 This REST ([Representational State Transfer](http://en.wikipedia.org/wiki/REST)) script can be invoked via http in the same way as the other TWiki scripts (see **Invocation Examples**, below) to execute a function that is associated to a "subject" and a "verb" (see below). These functions are usually registered by plugins using the `TWiki::Func::registerRESTHandler` method. The `rest` script will print the result directly to the browser unless the `endPoint` parameter is specified, in which case it will output a redirect to the given topic.
609
610 The `rest` script supports the following parameters:
611
612 <table border="1" cellpadding="0" cellspacing="0">
613   <tr>
614     <td><code>username</code></td>
615     <td> If <code>TemplateLogin</code>, or a similar login manager not embedded in the web server, is used, then you need to pass a username and password to the server. The <code>username</code> and <code>password</code> parameters are used for this purpose. </td>
616   </tr>
617   <tr>
618     <td><code>password</code></td>
619     <td> See <code>username</code></td>
620   </tr>
621   <tr>
622     <td><code>topic</code></td>
623     <td> If defined as the full name (including web) of a topic, then when the script starts up plugins will be passed this as the "current" topic. If not defined, then [[USERSWEB/WebHome]] will be passed to plugins. </td>
624   </tr>
625   <tr>
626     <td><code>endPoint</code></td>
627     <td> Where to redirect the response once the request is served, in the form "Web.Topic" </td>
628   </tr>
629 </table>
630
631 The function is free to use any other query parameters for its own purposes.
632
633 %X% The `rest` script should **always** require authentication in any TWiki that has logins. Otherwise there is a risk of opening up major security holes. So make sure you add it to the list of authenticated scripts if you are using `ApacheLogin`.
634
635 #### <a name="Invocation Examples"></a> Invocation Examples
636
637 The `rest` script assumes that it will be called with URL in the form:
638
639 `http://my.host/bin/rest/<subject>/<verb>`
640
641 where `<subject>` must be the [[WikiWord]] name of one of the installed [[TWikiPlugins]], and the `<verb>` is the alias for the function registered using the `TWiki::Func::registerRESTHandler` method. The `<subject>` and `<verb>` are then used to lookup and call the registered function.
642
643 `<subject>` and `<verb>` are checked for illegal characters exactly in the same way as the web and topic names.
644
645 As an example, the [[EmptyPlugin]] has registered a function to be used with the `rest` script under the subject **EmptyPlugin** and the verb **example**. Click below to see the `rest` script in action (run as [[TWikiGuest]]).
646
647 [Call the Plugin](http://www.dementia.org/twiki/rest/EmptyPlugin/example?debugenableplugin=EmptyPlugin)
648
649 Note that for Plugins to register REST handlers, they must be enabled in `configure`.
650
651 ### <a name="=save="></a> `save`
652
653 The `save` script performs a range of save-related functions, as selected by the `action` parameter.
654
655 <table border="1" cellpadding="0" cellspacing="0">
656   <tr>
657     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
658     <th bgcolor="#99CCCC"><strong> Description </strong></th>
659     <th bgcolor="#99CCCC"><strong> Default </strong></th>
660   </tr>
661   <tr>
662     <td><code>action_save=1</code></td>
663     <td><strong>default</strong>; save, return to view, dontnotify is <code>off</code></td>
664     <td>   </td>
665   </tr>
666   <tr>
667     <td><code>action_quietsave=1</code></td>
668     <td> save, and return to view, <code>dontnotify</code> is <code>on</code></td>
669     <td>   </td>
670   </tr>
671   <tr>
672     <td><code>action_checkpoint</code></td>
673     <td> save and redirect to the edit script, <code>dontnotify</code> is <code>on</code></td>
674     <td>   </td>
675   </tr>
676   <tr>
677     <td><code>action_cancel</code></td>
678     <td> exit without save, return to view </td>
679     <td>   </td>
680   </tr>
681   <tr>
682     <td><code>action_preview</code></td>
683     <td> preview edited text </td>
684     <td>   </td>
685   </tr>
686   <tr>
687     <td><code>action_addform</code></td>
688     <td> Redirect to the "change form" page. </td>
689     <td>   </td>
690   </tr>
691   <tr>
692     <td><code>action_replaceform...</code></td>
693     <td> Redirect to the "change form" page. </td>
694     <td>   </td>
695   </tr>
696   <tr>
697     <td><code>action_delRev</code></td>
698     <td><strong>Administrators only</strong> delete the most recent revision of the topic - all other parameters are ignored. You have to be an administrator to use this, and not all store implementations will support it. </td>
699     <td>   </td>
700   </tr>
701   <tr>
702     <td><code>action_repRev</code></td>
703     <td><strong>Administrators only</strong> replace the text of the most recent revision of the topic with the text in the <code>text</code> parameter. <code>text</code> must included embedded meta-data tags. All other parameters are ignored. You have to be an administrator to use this, and not all store implementations will support it. </td>
704     <td>   </td>
705   </tr>
706   <tr>
707     <td><code>onlynewtopic</code></td>
708     <td> If set, error if topic already exists </td>
709     <td>   </td>
710   </tr>
711   <tr>
712     <td><code>onlywikiname</code></td>
713     <td> If set, error if topic name is not a [[Main/WikiWord]]</td>
714     <td>   </td>
715   </tr>
716   <tr>
717     <td><code>dontnotify</code></td>
718     <td> if defined, suppress change notification </td>
719     <td>   </td>
720   </tr>
721   <tr>
722     <td><code>templatetopic</code></td>
723     <td> Name of a topic to use as a template for the text and form (new topic <em>only</em>) </td>
724     <td>   </td>
725   </tr>
726   <tr>
727     <td><code>text</code></td>
728     <td> New text of the topic </td>
729     <td>   </td>
730   </tr>
731   <tr>
732     <td><code>forcenewrevision</code></td>
733     <td> if set, forces a revision even if TWiki thinks one isn't needed </td>
734     <td>   </td>
735   </tr>
736   <tr>
737     <td><code>topicparent</code></td>
738     <td> If 'none' remove any current topic parent. If the name of a topic, set the topic parent to this. </td>
739     <td>   </td>
740   </tr>
741   <tr>
742     <td><code>formtemplate</code></td>
743     <td> if defined, use the named template for the form (will remove the form is set to 'none') </td>
744     <td>   </td>
745   </tr>
746   <tr>
747     <td><code>editaction</code></td>
748     <td> When action is <code>checkpoint</code>, <code>add form</code> or <code>replace form...</code>, this is used as the <code>action</code> parameter to the <code>edit</code> script that is redirected to after the save is complete. </td>
749     <td>   </td>
750   </tr>
751   <tr>
752     <td><code>originalrev</code></td>
753     <td> Revision on which the edit started. </td>
754     <td>   </td>
755   </tr>
756   <tr>
757     <td><code>edit</code></td>
758     <td> The script to use to edit the topic when action is <code>checkpoint</code></td>
759     <td><code>edit</code></td>
760   </tr>
761   <tr>
762     <td><code>editparams</code></td>
763     <td> The parameter string to use to edit the topic </td>
764     <td>   </td>
765   </tr>
766   <tr>
767     <td><code>redirectto</code></td>
768     <td> The save process will redirect to this topic or URL if it is successful. (Typically this would be the URL that was being viewed when edit was invoked). The parameter value can be a <code>TopicName</code>, a <code>Web.TopicName</code>, or a URL.%BR% <strong><em>Note:</em></strong> Redirect to a URL only works if it is enabled in <code>configure</code> (Miscellaneous <code>{AllowRedirectUrl}</code>). </td>
769     <td> view topic being edited </td>
770   </tr>
771 </table>
772
773 Any errors will cause a redirect to an `oops` page.
774
775 The parameters are interpreted in according to the following rules.
776
777 1. The first sequence of ten or more `X` characters in the topic name will be converted to a number such that the resulting topic name is unique in the target web.
778 2. When the action is `save`, `checkpoint`, `quietsave`, or `preview`:
779   1. The new text is taken from the `text` parameter, if it is defined,
780     - otherwise it is taken from the `templatetopic`, if it is defined, (new topic _only_)
781     - otherwise it is taken from the previous version of the topic, if any,
782   2. The name of the new form is taken from the `formtemplate`, if defined
783     - otherwise it is taken from the `templatetopic`, if defined, (new topic _only_)
784     - otherwise it is taken from the previous version of the topic, if any,
785     - otherwise no form is attached.
786   3. The value for each field in the form is taken from the query, if it is defined
787     - otherwise it is taken from the `templatetopic`, if defined, (new topic _only_)
788     - otherwise it is taken from the previous version of the topic, if any,
789     - otherwise it defaults to the empty string.
790
791 Merging is only enabled if the topic text comes from `text` and `originalrev` is &gt; 0 and is not the same as the revision number of the most recent revision. If merging is enabled both the topic and the meta-data are merged.
792
793 Form field values are passed in parameters named 'field' - for example, if I have a field `Status` the parameter name is `Status`.
794
795 ### <a name="=search="></a> `search`
796
797 CGI gateway to the `%SEARCH%` functionality driven by the following CGI parameters:
798
799 <table border="1" cellpadding="0" cellspacing="0">
800   <tr>
801     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
802     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
803     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
804   </tr>
805   <tr>
806     <td><code>"text"</code></td>
807     <td> Search term. Is a keyword search, literal search or regular expression search, depending on the <code>type</code> parameter. [[Main/SearchHelp]] has more </td>
808     <td> required </td>
809   </tr>
810   <tr>
811     <td><code>search="text"</code></td>
812     <td> (Alternative to above) </td>
813     <td> N/A </td>
814   </tr>
815   <tr>
816     <td><code>web="Name"</code><br /><code>web="%USERSWEB%, Know"</code><br /><code>web="all"</code></td>
817     <td> Comma-separated list of webs to search. See [[Main/TWikiVariables#VarSEARCH]] for more details. </td>
818     <td> Current web </td>
819   </tr>
820   <tr>
821     <td><code>topic="WebPreferences"</code><br /><code>topic="*Bug"</code></td>
822     <td> Limit search to topics: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. </td>
823     <td> All topics in a web </td>
824   </tr>
825   <tr>
826     <td><code>excludetopic="Web*"</code><br /><code>excludetopic="WebHome, WebChanges"</code></td>
827     <td> Exclude topics from search: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. </td>
828     <td> None </td>
829   </tr>
830   <tr>
831     <td><code>type="keyword"</code><br /><code>type="literal"</code><br /><code>type="regex"</code></td>
832     <td> Do a keyword search like <code>soap "web service" -shampoo</code>; a literal search like <code>web service</code>; or [[Main/RegularExpression]] search like <code>soap;web service;!shampoo</code></td>
833     <td><code>%SEARCHVAR- DEFAULTTYPE%</code> [[Main/TWikiPreferences]] setting (%SEARCHVARDEFAULTTYPE%) </td>
834   </tr>
835   <tr>
836     <td><code>scope="topic"</code><br /><code>scope="text"</code><br /><code>scope="all"</code></td>
837     <td> Search topic name (title); the text (body) of topic; or all (both) </td>
838     <td><code>"text"</code></td>
839   </tr>
840   <tr>
841     <td><code>order="topic"</code><br /><code>order="created"</code><br /><code>order="modified"</code><br /><code>order="editby"</code><br /><code>order=<br /> "formfield(name)"</code></td>
842     <td> Sort the results of search by the topic names, topic creation time, last modified time, last editor, or named field of [[Main/TWikiForms]]. The sorting is done web by web; in case you want to sort across webs, create a [[Main/FormattedSearch]] table and sort it with [[Main/TablePlugin]]'s initsort </td>
843     <td> Sort by topic name </td>
844   </tr>
845   <tr>
846     <td><code>limit="all"</code><br /><code>limit="16"</code></td>
847     <td> Limit the number of results returned. This is done after sorting if <code>order</code> is specified </td>
848     <td> All results </td>
849   </tr>
850   <tr>
851     <td><code>date="..."</code></td>
852     <td> limits the results to those pages with latest edit time in the given [[Main/TimeSpecifications#TimeIntervals]]. </td>
853     <td> All results </td>
854   </tr>
855   <tr>
856     <td><code>reverse="on"</code></td>
857     <td> Reverse the direction of the search </td>
858     <td> Ascending search </td>
859   </tr>
860   <tr>
861     <td><code>casesensitive="on"</code></td>
862     <td> Case sensitive search </td>
863     <td> Ignore case </td>
864   </tr>
865   <tr>
866     <td><code>bookview="on"</code></td>
867     <td>[[Main/BookView]] search, e.g. show complete topic text </td>
868     <td> Show topic summary </td>
869   </tr>
870   <tr>
871     <td><code>nonoise="on"</code></td>
872     <td> Shorthand for <code>nosummary="on" nosearch="on" nototal="on" zeroresults="off" noheader="on" noempty="on"</code></td>
873     <td> Off </td>
874   </tr>
875   <tr>
876     <td><code>nosummary="on"</code></td>
877     <td> Show topic title only </td>
878     <td> Show topic summary </td>
879   </tr>
880   <tr>
881     <td><code>nosearch="on"</code></td>
882     <td> Suppress search string </td>
883     <td> Show search string </td>
884   </tr>
885   <tr>
886     <td><code>noheader="on"</code></td>
887     <td> Suppress search header <br /><span style="background: #FFB0B0"> <strong>Topics: Changed: By:</strong> </span></td>
888     <td> Show search header </td>
889   </tr>
890   <tr>
891     <td><code>nototal="on"</code></td>
892     <td> Do not show number of topics found </td>
893     <td> Show number </td>
894   </tr>
895   <tr>
896     <td><code>zeroresults="off"</code></td>
897     <td> Suppress all output if there are no hits </td>
898     <td><code>zeroresults="on"</code>, displays: "Number of topics: 0" </td>
899   </tr>
900   <tr>
901     <td><code>noempty="on"</code></td>
902     <td> Suppress results for webs that have no hits. </td>
903     <td> Show webs with no hits </td>
904   </tr>
905   <tr>
906     <td><code>header="..."</code><br /><code>format="..."</code></td>
907     <td> Custom format results: see <strong>[[Main/FormattedSearch]]</strong> for usage, variables &amp; examples </td>
908     <td> Results in table </td>
909   </tr>
910   <tr>
911     <td><code>expandvariables="on"</code></td>
912     <td> Expand variables before applying a [[Main/FormattedSearch]] on a search hit. Useful to show the expanded text, e.g. to show the result of a [[Main/SpreadSheetPlugin]] <code>%CALC{}%</code> instead of the formula </td>
913     <td> Raw text </td>
914   </tr>
915   <tr>
916     <td><code>multiple="on"</code></td>
917     <td> Multiple hits per topic. Each hit can be [[Main/FormattedSearch]]. The last token is used in case of a regular expression ";" <em>and</em> search </td>
918     <td> Only one hit per topic </td>
919   </tr>
920   <tr>
921     <td><code>nofinalnewline="on"</code></td>
922     <td> If <code>on</code>, the search variable does not end in a line by itself. Any text continuing immediately after the search tag on the same line will be rendered as part of the table generated by the search, if appropriate. </td>
923     <td><code>off</code></td>
924   </tr>
925   <tr>
926     <td><code>separator=", "</code></td>
927     <td> Line separator between hits </td>
928     <td> Newline <code>"$n"</code></td>
929   </tr>
930 </table>
931
932 ### <a name="=statistics="></a> `statistics`
933
934 Refresh the [[WebStatistics]] topics in range of webs.
935
936 <table border="1" cellpadding="0" cellspacing="0">
937   <tr>
938     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
939     <th bgcolor="#99CCCC"><strong> Description </strong></th>
940     <th bgcolor="#99CCCC"><strong> Default </strong></th>
941   </tr>
942   <tr>
943     <td><code>webs</code></td>
944     <td> comma-separated list of webs to run stats on </td>
945     <td> all accessible webs </td>
946   </tr>
947   <tr>
948     <td><code>logdate</code></td>
949     <td> YYYYMM to generate statistics for </td>
950     <td> current month </td>
951   </tr>
952 </table>
953
954 for example:
955
956 1. from browser <http://www.dementia.org/twiki/statistics> updates _all user webs_
957 2. from browser <http://www.dementia.org/twiki/statistics?webs=TWiki,Main,Sandbox> updates _TWiki,Main,Sandbox_
958 3. from browser <http://www.dementia.org/twiki/statistics/%WEB%> updates %WEB%
959 4. from command line twiki/bin/statistics updates _all user webs_
960 5. from command line twiki/bin/statistics -webs=TWiki,Main,Sandbox updates _TWiki,Main,Sandbox_
961 6. from command line twiki/bin/statistics %WEB%.WebHome updates %WEB%
962
963 see [[TWikiSiteTools#WebStatistics_site_statistics]] for updating statistics using cron.
964
965 ### <a name="=upload="></a> `upload`
966
967 Uploads an attachment to a topic. The HTTP request is expected to be in `multipart/form-data` format.
968
969 <table border="1" cellpadding="0" cellspacing="0">
970   <tr>
971     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
972     <th bgcolor="#99CCCC"><strong> Description </strong></th>
973     <th bgcolor="#99CCCC"><strong> Default </strong></th>
974   </tr>
975   <tr>
976     <td><code>hidefile</code></td>
977     <td> if defined, will not show file in attachment table </td>
978     <td>   </td>
979   </tr>
980   <tr>
981     <td><code>filepath</code></td>
982     <td> local (client) path name of the file being uploaded. This is used to look up the data for the file in the HTTP query. </td>
983     <td>   </td>
984   </tr>
985   <tr>
986     <td><code>filename</code></td>
987     <td> deprecated, do not use </td>
988     <td>   </td>
989   </tr>
990   <tr>
991     <td><code>filecomment</code></td>
992     <td> Comment to associate with file in attachment table </td>
993     <td>   </td>
994   </tr>
995   <tr>
996     <td><code>createlink</code></td>
997     <td> if defined, will create a link to file at end of topic </td>
998     <td>   </td>
999   </tr>
1000   <tr>
1001     <td><code>changeproperties</code></td>
1002     <td> if defined, this is a property change operation <strong>only</strong> - no file will be uploaded. </td>
1003     <td> null </td>
1004   </tr>
1005 </table>
1006
1007 You can use a tool like `curl` to upload files from the command line using this script.
1008
1009 ### <a name="=view="></a> `view`
1010
1011 Used for viewing topics.
1012
1013 <table border="1" cellpadding="0" cellspacing="0">
1014   <tr>
1015     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
1016     <th bgcolor="#99CCCC"><strong> Description </strong></th>
1017     <th bgcolor="#99CCCC"><strong> Default </strong></th>
1018   </tr>
1019   <tr>
1020     <td><code>raw=on</code></td>
1021     <td> Shows the text of the topic in a scrollable textarea </td>
1022     <td>   </td>
1023   </tr>
1024   <tr>
1025     <td><code>raw=debug</code></td>
1026     <td> As <code>raw=on</code>, but also shows the metadata (forms etc) associated with the topic. </td>
1027     <td>   </td>
1028   </tr>
1029   <tr>
1030     <td><code>raw=text</code></td>
1031     <td> Shows only the source of the topic, as plain text (Content-type: text/plain). Only shows the body text, <strong>not</strong> the form or other meta-data. </td>
1032   </tr>
1033   <tr>
1034     <td><code>raw=all</code></td>
1035     <td> Shows only the source of the topic, as plain text (Content-type: text/plain), <strong>with embedded meta-data</strong>. This may be useful if you want to extract the source of a topic to a local file on disc. </td>
1036     <td>   </td>
1037   </tr>
1038   <tr>
1039     <td><code>section</code></td>
1040     <td> Allows to view only a part of the topic delimited by a named section (see %SYSTEMWEB%.VarSTARTSECTION). If the given section is not present, no topic content is displayed. </td>
1041     <td>   </td>
1042   </tr>
1043   <tr>
1044     <td><code>contenttype</code></td>
1045     <td> Allows you to specify a different <strong>Content-Type:</strong> (e.g. <code>contenttype=text/plain</code>) </td>
1046     <td>   </td>
1047   </tr>
1048   <tr>
1049     <td><code>rev</code></td>
1050     <td> Revision to view (e.g. <code>rev=45</code>) </td>
1051     <td>   </td>
1052   </tr>
1053   <tr>
1054     <td><code>template</code></td>
1055     <td> Allows you to specify a different skin template, overriding the 'view' template the view script would normally use. The default template is <code>view</code>. For example, you could specify [[%WEB%/%TOPIC%?template=edit]]. This is mainly useful when you have specialised templates for a TWiki Application. </td>
1056     <td>   </td>
1057   </tr>
1058   <tr>
1059     <td><code>topic</code></td>
1060     <td> redirects (at the beging of the cgi script running) to show the spcified Web.Topic, or, redirects to a URL, if allowed by {AllowRedirectUrl} and {PermittedRedirectHostUrls} </td>
1061     <td>   </td>
1062   </tr>
1063 </table>
1064
1065 %X% For historical reasons, the view script has a special interpretation of the `text` skin. In earlier TWiki versions the `skin=text` parameter was used like this: `http://.../view/MyWeb/MyTopic?skin=text&contenttype=text/plain&raw=on` which shows the topic as plain text; useful for those who want to download plain text for the topic. Using `skin=text` this way is **DEPRECATED**, use `raw=text` instead.
1066
1067 ### <a name="=viewfile="></a> `viewfile`
1068
1069 Used for viewing attachments. Normally, a site will publish the attachments (`pub`) directory using a URL. However if it contains sensitive information, you will want to protect attachments using [[TWikiAccessControls]]. In this case, you can use the `viewfile` script to give access to attachments while still checking access controls.
1070
1071 <table border="1" cellpadding="0" cellspacing="0">
1072   <tr>
1073     <th bgcolor="#99CCCC"><strong> Parameter </strong></th>
1074     <th bgcolor="#99CCCC"><strong> Description </strong></th>
1075     <th bgcolor="#99CCCC"><strong> Default </strong></th>
1076   </tr>
1077   <tr>
1078     <td><code>filename</code></td>
1079     <td> name of attachment </td>
1080     <td>   </td>
1081   </tr>
1082   <tr>
1083     <td><code>rev</code></td>
1084     <td> Revision to view </td>
1085     <td>   </td>
1086   </tr>
1087 </table>
1088
1089 Instead of using the `filename` parameter, you can append the attachment name to the end of the URL path (after the topic) e.g. `http://www.dementia.org/twiki/viewfile/Webname/TopicName/Attachment.gif`
1090
1091 ## <a name="Command Line Scripts"></a> Command Line Scripts
1092
1093 Details on command line scripts located in the `twiki/tools` directory.
1094
1095 ### <a name="=geturl.pl="></a> `geturl.pl`
1096
1097 This is a very simple script to get the content of a web site. It is marked as _deprecated_ and might be removed (or enhanced) in a future TWiki release. Its functions are covered by the standard `wget` and `curl` commands.
1098
1099 - Usage: `geturl.pl <host> <path> [<port> [<header>]]`
1100 - Example: `geturl.pl some.domain /some/dir/file.html 80`
1101 - Will get: `http://some.domain:80/some/dir/file.html`
1102
1103 ### <a name="=rewriteshebang.pl="></a> `rewriteshebang.pl`
1104
1105 Simple script to rewrite the `#!/usr/bin/perl` shebang lines specific to your local Perl installation. It will rewrite the first line of all your TWiki cgi scripts so they use a different shebang line. Use it if your perl is in a non-standard location, or you want to use a different interpreter (such as 'speedy').
1106
1107 ### <a name="=tick_twiki.pl="></a> `tick_twiki.pl`
1108
1109 This script executes a number of non-essential regular administration tasks that will help keep your TWiki healthy and happy, such as removing expired sessions and lease files.
1110
1111 It is intended to be run as a cron job or a scheduled task once a week. Example crontab entry:%BR% `0 0 * * 0 cd /usr/twiki/bin && perl ../tools/tick_twiki.pl`
1112
1113 **_Note:_** The script has to be run by a user who can write files created by the webserver user.
1114
1115 **_Related Topics:_** [[AdminDocumentationCategory]], [[DeveloperDocumentationCategory]]