Some tasks have to be run on the survey server regularly: archiving old projects, deleting temporary files, deleting obsolete user accounts (inactive members) and optimization of database tables.
A maintenance script /admin/cronjob.php
performs these tasks. This script is password-protected, which you can set in Server Settings under Configuration. This password is passed to the script as the parameter password
.
It makes sense to run maintenance daily. The PHP interpreter is called up in order to do so – the PHP file (with a complete path), and the password as the second parameter is passed to this.
You can copy the PHP script's complete path directly in Server Settings → Configuration → Server tab → Script for Sever Maintenance.
Setting this to run automatically in Windows and Linux is described in the Scheduled Tasks chapter. In Linux, the crontab
entry for this to be run daily at 4.30 could look as follows:
30 4 * * * /usr/lib/cgi-bin/php /var/www/html/sosci/admin/cronjob.php password=SECRET
Server maintenance can also be carried out manually.
The cronjob returns the following messages:
ok
– Cronjob complete: everything is working correctlywarning
– Cronjob complete: there were warningserror
– Cronjob complete: there were errorsdenied
– Password is incorrect (if provided)delayed
– Cronjob was performed within the last 6 hours and does not have to be carried out again at this moment in timeThe server administrator will receive an email with further details regarding the cronjob, which also lists uploaded files, new user accounts and projects. Some pieces of information from the cronjob (e.g. deleted users and projects) will also be noted in the cronjob log file.