This translation is older than the original page and might be outdated. See what has changed.
Translations of this page:

Table of Contents

Scheduled Tasks

SoSci Survey has several time-controlled features, e.g. it can transfer questionnaires to the database when the server is not so busy (Caching for Questionnaires), send mailings at certain times, or (still in development) provide regular notifications regarding the number of survey participants.

The script admin/crontask.php has to be run at regular intervals for the scheduled features to work properly. Invoking the script every 5 minutes is recommended - if the script is invoked any less than this, the time the task will be processed will differ greatly from the time you had planned.

To set up the scheduled task, the absolute path of the PHP script is required. Copy this path from Server SettingsConfiguration → Tab ServerCrontask script.

Note: Regular Maintenance of the Server via admin/cronjob.php has to be performed independently of the cache being transmitted. A reasonable interval here would be 24 hours.


Enter the following cronjob to run the script every 5 minutes on a Linux system. Set the password in SoSci Survey in Server ManagementServer Settings.

*/5  *  *  *  *  /usr/lib/cgi-bin/php /var/www/html/sosci/admin/crontask.php password=SECRET

To register the cronjob, use crontab. Create the cronjob for the Linux user (in the example below www-data) that is also used to run the web server. This avoids trouble with file permissions.

sudo crontab -e -u www-data


In Windows, the Task Scheduler is used to regularly run scripts (Scheduled Tasks, Task Scheduler)

An executable file is needed which will be invoked by the PHP interpreter and passed as a parameter by the PHP script. A simple batch file could be used here (*.bat). The folder in the following example has to be adapted to fit the respective installation.

C:\php\php.exe C:\webserver\documents\sosci\admin\crontask.php password=SECRET

Run the file as a test to check the folders. The file will be then be created as a task in the Task Scheduler which will enable it to run regularly.

  • Windows XP: Control Panel → Scheduled Tasks → Add Scheduled Task (Cron Job in Windows)
  • Windows 7: Control Panel → System and Security → Administrative Tools → Task Scheduler → Create Basic Task (Schedule a Task)
  • Windows 8: Run (Windows button + r) → type in taskschd.msc → OK → Action → Create Basic Task (Windows 8.1 Task Scheduler)
en/server/crontask.txt · Last modified: 29.04.2021 21:55 by sophia.schauer
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki