# Cron (automatic tasks) setup

### Setting Moodle up for run tasks automatically

1. Login to server as root
2. Open crontab  
      
    `crontab -e`
3. Add the below line to crontab (replacing moodlefolder with the actual Moodle folder)

```
*/5 * * * * /usr/bin/php /var/www/moodlefolder/admin/cli/cron.php >/dev/null
```

<p class="callout info">The above example will run the command every 5 min</p>