Cron on 1and1 shared servers
Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: Cron on 1and1 shared servers.
The following information is taken from the 1and1 FAQs and should be read in conjunction with the instructions for Cron_with_Unix_or_Linux:
The following pages explain very clearly how to do the basic tasks:
- How to connect to the server via SSH (including downloading and using a small program called putty.exe): http://faq.1and1.com/web_space__access/ssh/3.html
- How to create and edit a file of your own called cronTest.php and how to find the paths to the files you need to make it work: http://faq.1and1.com/scripting_languages_supported/cron_jobs/3.html
All the necessary know-how to set up your cron by editing the crontab is now available to you after following the above tutorial. All you now need is to work out exactly what to add to your crontab, now that you can find it and edit it. This is found on the moodle docs page above. Specifically:
- /15 * * * * /usr/bin/php /path/to/moodle/admin/cli/cron.php
The /usr/bin/php path for 1and1.co.uk to be the same as in the tutorial and moodle pages, so it is exactly as shown.
For the /path/to/moodle/admin/cli you need to type the path you found during the above tutorial, which should look something like /username/homepages/nn/.../htdocs/moodle/admin/cron.php. This is the bit you might have difficulty with if you have used a one-click installation. Where is your moodle? For me my moodle is right inside my htdocs as shown in the above path. If you have got to the command line, the command 'pwd' shows you the complete path to where you are now. This should help you work it out.