Results 1 to 3 of 3
I've got a bash script that invokes some php scripts that in turn do some data manipulation, return some files that the bash script then compresses (zips). The bash file ...
- 05-17-2007 #1Just Joined!
- Join Date
- Feb 2007
- Posts
- 3
Problem with bash, cron and php interaction
I've got a bash script that invokes some php scripts that in turn do some data manipulation, return some files that the bash script then compresses (zips). The bash file and the php scripts work fine when invoked from the CLI, but do not work when invoked from cron. Cron runs the shell script fine.
The area of the Bash script that contains the php invoking looks like:
I know that I'm 'getting' into the else statement fine.Code:if [ "$curperiod" == "$period" ]; then if [ -s $zipfilename ]; then echo "There is already a zip file present for that date" exit else /usr/local/bin/php -q results_0001_1.php >> data.log /usr/local/bin/php -q results_0001_4.php >> data.log /usr/local/bin/php -q results_month.php >> data.log /usr/local/bin/php -q results_week.php >> data.log echo "The following files were created:" > /home/email_log #list the files and their sizes du -a $DIR/*.csv >> /home/email_log
Stumped.
- 05-17-2007 #2
Perhaps your problem is because you aren't using exact paths to your files. Maybe you should modify your file names to include the full path to the file.
- 05-17-2007 #3Just Joined!
- Join Date
- Feb 2007
- Posts
- 3
Thanks Matt. That was it and I feel like an idiot. Forest through the trees and all that.


Reply With Quote