Hi everyone,
I wrote a nice little script.
If I run it from command line everything is fine.
If I put it into crontab it gets executed but won't give me the correct output.
I assume this is because of the variable $searchstring is being ignored because of some unknown reason ...
Here's the script:
day=$(date +%e)
yesterday=`expr $day - 1`
month=$(date +%m)
year=$(date +%Y)
searchstring=$(echo "$year$month$yesterday")
iaccess -q "select EXTPRIM, K1200, K1112 from TBSP where DOCDATE = $searchstring" -v LOW -f SQL |wc > /tmp/count_TBSP.out
-> I believe the error occurs in "DOCDATE = $searchstring" but I'm not sure about that.
What's wrong here ?
Why does crontab fail when I'm able to run the script directly from command line without any problems ?
Regards
Thomas
I wrote a nice little script.
If I run it from command line everything is fine.
If I put it into crontab it gets executed but won't give me the correct output.
I assume this is because of the variable $searchstring is being ignored because of some unknown reason ...
Here's the script:
day=$(date +%e)
yesterday=`expr $day - 1`
month=$(date +%m)
year=$(date +%Y)
searchstring=$(echo "$year$month$yesterday")
iaccess -q "select EXTPRIM, K1200, K1112 from TBSP where DOCDATE = $searchstring" -v LOW -f SQL |wc > /tmp/count_TBSP.out
-> I believe the error occurs in "DOCDATE = $searchstring" but I'm not sure about that.
What's wrong here ?
Why does crontab fail when I'm able to run the script directly from command line without any problems ?
Regards
Thomas