cronjob does not execute a script that works fine standalone
问题 I have my php script file in /var/www/html/dbsync/index.php . When cd /var/www/html/dbsync/ and run php index.php it works perfectly. I want to call PHP file through sh file, the location of SH file is as below /var/www/html/dbsync/dbsync.sh This is the content of the dbsync.sh file is: /usr/bin/php /var/www/html/dbsync/index.php >> /var/www/html/dbsync/myscript.log 2>&1 -q -f When I cd /var/www/html/dbsync/ and run ./dbsync.sh it works perfectly as well. Now if I set up crontab as below: 1 *