Php per Cronjob ausführen
Hallo,
ich habe ein php script, welches ich unter root per cronjob ausführen lasse.
enthalten ist folgender befehl:
$address = trim(shell_exec('su -c "./folder/command '.$account.'" ubuntu 2>&1'));
sowohl unter dem user ubuntu mit sudo php create.php
als auch nach
sudo su
php create.php
Läuft das Script problemlos.
Wird es aber aber per cronjob als root ausgeführt, kommt für $address => "bash: ./folder/command: Permission denied"
Wo könnte hier das Problem liegen?
ich habe ein php script, welches ich unter root per cronjob ausführen lasse.
enthalten ist folgender befehl:
$address = trim(shell_exec('su -c "./folder/command '.$account.'" ubuntu 2>&1'));
sowohl unter dem user ubuntu mit sudo php create.php
als auch nach
sudo su
php create.php
Läuft das Script problemlos.
Wird es aber aber per cronjob als root ausgeführt, kommt für $address => "bash: ./folder/command: Permission denied"
Wo könnte hier das Problem liegen?
Please also mark the comments that contributed to the solution of the article
Content-Key: 427272
Url: https://administrator.de/contentid/427272
Printed on: April 20, 2024 at 03:04 o'clock
3 Comments
Latest comment