Blog

Call URL via CronJob

By using a CronJob, you can easily invoke URLs at regular intervals, in addition to running scripts or other commands. Many content management systems, for example, rely on such cyclic invocations.

To set up a CronJob to open a URL, you need to prepend "wget -q" to the command, instead of simply inserting the URL. Here's an example:

0 3 * * * wget -q https://www.sebastian-widmann.de/cronjob.php

The above CronJob would be executed every night at 3:00 AM. If you want to invoke the URL every 5 minutes instead, the command would look like this:

*/5 * * * * wget -q https://www.sebastian-widmann.de/cronjob.php

In this case, the URL would be called every 5 minutes.