I am going crazy as not understanding what I am doing wrong.
I wrote this bash script to run a php script with nohup. It looks like this:
#!/bin/bash
nohup /usr/bin/php /opt/bitnami/nginx/html/folder/script.php $argv > fileoutput.txt 2>&1 &
when I run in in terminal as ./script.sh it does work, I can see the process running if I grep php and also my database updates.
Now I am trying to automate this process with crontab with this instruction:
43 * * * * /bin/sh /opt/bitnami/nginx/html/folder/script.sh
I am just changing the minute currently to test the automation as I will add a cycle of $argv to be executed when I manage to get this to work.
I have applied chmod 777 to the script.sh and now I really have no idea what else to fix.
Thanks in advance!
$argv
and how is it set? it's unlikely that it will be in thecron
execution environment. Do you see any errors infileoutput.txt
?