This is my code in scriptrun (name of my shell script):

php -f a1.php; php -f b2.php; sh -e c3.txt

This is my cronjob command: /home/telia/www/robot/scriptrun, created as root

When I run script I get error message

Could not open input file: a1.php      
Could not open input file: b2.php 

scriptrun file is already have +x and I already tried

/usr/bin/php -f a1.php; /usr/bin/php b2.php ;sh -e c3.txt

I tried giving 777 chmod to php files however doesn't change anything.

script runs perfectly if I try manually it is just not work with cronjob.

  • 3
    Enter the full path to the a1.php, b2.php and c3.txt files Commented Oct 5, 2017 at 13:03

1 Answer 1


As was answered in a comment, the problem appears to be that your a1.php and b2.php scripts are not in your $HOME directory, which is where cron jobs will execute. Either add a cd /to/that/path command to your scriptrun script, or change the php commands to use the full path to those scripts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .