I want to execute à Symfony3 command on a OVH mutualised server but i still get an error.
i created a sh script "verifyCampaign.sh" and put in www/cron :
#!/bin/bash
cd /home/siteName/www/
/usr/local/php7.0/bin/php /home/siteName/www/bin/console app:verify-campaign
I know OVH find my script because i have this information in the cron log :
[2017-06-17 04:38:01] ## OVH ## START - 2017-06-17 04:38:01.601227 executing: /homez.76/siteNamesrd/./www/cron/verifyCampaign.sh
[2017-06-17 04:38:01] ## OVH ## ERROR command '/homez.76/siteNamesrd/./www/cron/verifyCampaign.sh' must be executable
[2017-06-17 04:38:01]
[2017-06-17 04:38:01] ## OVH ## END - 2017-06-17 02:38:01.725728 exitcode: 255
But why it is telling me this error ? When i try my command in the console online it's working well
EDIT
In chmod 777 i have a new error :
[2017-06-20 14:53:01] ## OVH ## START - 2017-06-20 14:53:01.977160 executing: /homez.76/siteName/./www/cron/verifyCampaign.sh
[2017-06-20 14:53:01] /homez.76/siteName/./www/cron/verifyCampaign.sh: line 2: cd: /home/siteName/www/: No such file or directory
[2017-06-20 14:53:01] Could not open input file: /home/siteName/www/bin/console
[2017-06-20 14:53:01]
[2017-06-20 14:53:01] ## OVH ## END - 2017-06-20 12:53:02.165789 exitcode: 1
I gonna try different path now. So it's seems it's the right on the script that was the problem
EDIT - IMPROVE ANSWER
As said in the accepted answer, the problem was the access right on the script file .
For the other problem, in ovh the right path for access to your folder is :
/homez.id/SiteUserName/www/
In my case id = 76
So if you wangt to execute a Symfony3 command you have to do like that :
#!/bin/bash
cd /homez.id/siteUserName/www/
/usr/local/php7.0/bin/php /homez.id/siteUserName/www/bin/console your:commandName
In my case, your:commandName = app:verify-campaign
It's telling you that the script does not have the execute bit set allowing the cron user who is running it to execute it. You would need to use chmod to do that. This might be overkill but:
chmod ugo+x verifyCampaign.sh
Will certainly take care of it.