o
Cronjob.de › Guides › Webspace
On a server of your own you put a cronjob into the crontab. On shared web space that almost never works: you have FTP and a control panel, but no command line. This guide shows the approach that works with every host: your script becomes callable through an address, and a service calls that address on a schedule.
Why at all
Shared web space means sharing a server with many other customers. That is why hosts give you no access to the crontab there, and usually no SSH either. What you get instead depends on your package.
Some hosts offer a cron manager of their own. Often, though, it only comes with larger packages, knows only coarse intervals such as daily or hourly, or aborts scripts after a few minutes. What that looks like at individual hosts is covered in our guides for STRATO, IONOS, All-Inkl and Host Europe.
The stopgap many systems use is a cron that piggybacks on page visits, such as WP-Cron in WordPress. But it only runs while somebody happens to open the site. At night, on quiet sites or behind a page cache the work is left undone, and with many visitors it slows the site down.
https://ihre-domain.de/cron.php?key=…Setup
The AI does it faster
You do not have to transfer any of this by hand. Paste this guide – or the one for your own system – into the assistant, and Cronjob.de fills in address, method, schedule and headers. Where something is unclear it asks instead of guessing. At the end you see what was entered and create the job with one click.
Included in the free plan at no extra cost. You will find it after signing in under "Cronjobs" → "Create with AI".
Many systems ship a ready-made file that works through their scheduled tasks, such as wp-cron.php in WordPress or cron.php in Nextcloud. In that case you do not need a script of your own and can go straight to the step "Test in the browser". The addresses of common systems are listed in the guide overview.
For tasks of your own, upload a PHP file to your web space via FTP, for example cron.php. Its first line checks a secret key so that not every visitor can trigger the work. Your actual code follows after that.
<?php
// cron.php - called on a schedule by Cronjob.de
if (!isset($_GET['key']) || !hash_equals('A-LONG-SECRET', (string) $_GET['key'])) {
http_response_code(403);
exit;
}
ignore_user_abort(true); // keep working even if the caller hangs up
set_time_limit(300);
// ... the actual work goes here: sync data, send mails, clean up ...
echo 'OK';
Replace A-LONG-SECRET with a random string of at least 30 characters, for example from your password manager. Letters and digits only, so there is nothing to encode in the address. The finished address looks like this:
https://your-domain.com/cron.php?key=k8Qz3vN1pR7wXc2mT9bL5sHf4gJd6aYe
Open the address once with the key: the correct answer is OK. Then once without the key: now you must get an empty page with error 403. If the browser asks for a password or your host shows an error page, directory protection or a firewall is in the way.
Registration takes a minute and is free. Five cronjobs stay free forever, the first 14 days run on the Unlimited plan.
Enter the address including the key and choose the interval. If your script sits behind directory protection, store user name and password in the cronjob's advanced settings.
*/5 * * * *
You can enter this expression at Cronjob.de exactly as it is – the schedule field understands crontab notation. But you do not have to know it: simply click the schedule together instead.
What the five fields of an expression like */5 * * * * mean is explained in the crontab reference – with examples and the most common pitfalls. You can build the expression in the crontab generator. Whether you need an outside service at all is shown in the comparison of the three ways.
Verification
In the Cronjob.de call log you will see every call within a few minutes, with status, runtime and the start of the response, which for this script is OK. If a call fails, you can get an email. For the very first test you can also have the script write date and time into a file.
FAQ
ignore_user_abort(true) your script keeps working at most hosts anyway, until their own time limit kicks in. It is safer to split large jobs into chunks: for example 100 records per call, but more often.Cronjob.de
in the user agent. Ask your host for an exception for it; that is more reliable than allowing IP addresses, because ours can change. Addresses and details in the FAQ.
Create an account, enter the address, click the schedule. Five cronjobs are free forever, the first 14 days run on the Unlimited plan.
Start for free See pricing