# Nur bestimmten Shopware Cronjob aufrufen

**URL:** <https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325>\
**Category:** Programmierung\
**Created:** [2. September 2020 um 09:07 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325 "2020-09-02T09:07:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [2. September 2020 um 09:07 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/1 "2020-09-02T09:07:30Z")

</div>

Hi, für den Newslettercronjob gibt es laut zahlreichen Anleitungen die URL [example.com/backend/newsletter/cron](http://example.com/backend/newsletter/cron). OK.

Doch wie kann ich die den Cronjob **RefreshSeoIndex&nbsp;** aufrufen? Hier bekomme ich als Antwort " **Controller “RefreshSeoIndex” not found**"

Falls das nicht geht, wie kann man aus PHP heraus die CLI Befehle ausfüren? Oder kann man einen Cronjobaufruf auf den CLI geben?

Danke und Gruss

SW 5.6.7

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [2. September 2020 um 09:13 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/2 "2020-09-02T09:13:30Z")

</div>

Hallo,

über CLI kannst Du auch einzelne Crons aufrufen - Details findest Du über den Befehl bin/console sw:cron:run --help

&nbsp;

Usage:  
&nbsp; sw:cron:run [options] [–] []

Arguments:  
&nbsp; cronjob &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If given, only run the cronjob which action matches, e.g. ‚Shopware\_CronJob\_ClearHttpCache‘

Options:  
&nbsp; -f, --force &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If given, the cronjob(s) will be run regardless of scheduling  
&nbsp; -h, --help &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Display this help message  
&nbsp; -q, --quiet &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Do not output any message  
&nbsp; -V, --version &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Display this application version  
&nbsp; &nbsp; &nbsp; --ansi &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Force ANSI output  
&nbsp; &nbsp; &nbsp; --no-ansi &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Disable ANSI output  
&nbsp; -n, --no-interaction &nbsp; &nbsp; Do not ask any interactive question  
&nbsp; &nbsp; &nbsp; --process-isolation &nbsp;Launch commands from shell as a separate process.  
&nbsp; -e, --env=ENV &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The Environment name. [default: „production“]  
&nbsp; -v|vv|vvv, --verbose &nbsp; &nbsp; Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:  
&nbsp; The sw:cron:run runs due cronjobs.

&nbsp;

Viele Grüße

&nbsp;

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [2. September 2020 um 09:14 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/3 "2020-09-02T09:14:43Z")

</div>

Ich mache das über CLI sw:rebuild:seo:index

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [2. September 2020 um 09:18 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/4 "2020-09-02T09:18:05Z")

</div>

Vielen Dank,@SCOOPEX‍

wie kann man die aus PHP heraus aufrufen bzw in @TimmeHosting‍ als einzelnen Cron aufrufen?

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [2. September 2020 um 09:19 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/5 "2020-09-02T09:19:56Z")

</div>

Ich habe das in einer eigenen Schnittstelle mit eingebaut und rufe das ganze mittels PHP und exec() auf. Aber so ein Cronjob kann auch über SSH ausgeführt werden:

```
/opt/plesk/php/7.3/bin/php bin/console sw:rebuild:seo:index

```

(nur ein Beispiel)

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [2. September 2020 um 09:22 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/6 "2020-09-02T09:22:25Z")

</div>

mhhh, gibts auch was anderes ausser ausgerechnet exec ? 😛 @R4M‍

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [2. September 2020 um 09:24 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/7 "2020-09-02T09:24:29Z")

</div>

> [@brettvormkopp schrieb:](https://forum.shopware.com/profile/6611/brettvormkopp "brettvormkopp")
> 
> mhhh, gibts auch was anderes ausser ausgerechnet exec ? 😛 @R4M‍

Ja klar, steht in der Doku zu PHP exec(), aber in meinem Falle habe ich eine externe Verwaltung wo am Ende das ausgeführt werden soll.&nbsp;

---

<div class="post-metadata">

**Author:** ![SCOOPEX](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/scoopex/32/18328_2.png) [@SCOOPEX](https://forum.shopware.com/u/SCOOPEX)\
**Post date:** [2. September 2020 um 09:43 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/8 "2020-09-02T09:43:41Z")

</div>

Hallo,

hier findest Du analog die Anleitung für Cronjobs bei ISPConfig:

[https://timmehosting.de/anlegen-eines-cron-jobs](https://timmehosting.de/anlegen-eines-cron-jobs)

Viele Grüße

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [2. September 2020 um 09:45 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/9 "2020-09-02T09:45:08Z")

</div>

Du kannst einen symfony command auch via PHP ausführen. Siehe z.B.&nbsp;[https://symfony.com/doc/current/console/command\_in\_controller.html](https://symfony.com/doc/current/console/command_in_controller.html)

Viele Grüße

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [2. September 2020 um 09:49 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/10 "2020-09-02T09:49:22Z")

</div>

@EikeBrandtWarneke‍ Das sieht sehr aufgeräumt aus. THX.

---

<div class="post-metadata">

**Author:** ![TimmeHosting](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/timmehosting/32/15580_2.png) [@TimmeHosting](https://forum.shopware.com/u/TimmeHosting)\
**Post date:** [2. September 2020 um 13:51 UTC](https://forum.shopware.com/t/nur-bestimmten-shopware-cronjob-aufrufen/69325/11 "2020-09-02T13:51:59Z")

</div>

Ich würde empfehlen, einen Cron Job in ISPConfig anzulegen, wie von @SCOOPEX‍ vorgeschlagen. Der Befehl könnte dann wie folgt aussehen:

```
[php] bin/console sw:rebuild:seo:index

```

[php] wird automatisch vom ISPConfig durch die PHP-Version ersetzt, die Du für Deine Website ausgewählt hast.

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/385eaa628505df573ebf33722f780335f53ac1b2.png)

Timme Hosting - schnelles nginx-Hosting

[www.timmehosting.de](https://timmehosting.de/)
