storing the variable value while run from cron -


sh

!/bin/sh

export count=$(sqlplus -s 'username/passwd@xyz'<

when run script manual , script runs fine. when keep in crontab entry follows

27 16 * * * /www/abc/a4.sh >a4.log

the a4.log doesnot have data echoed.

please let know how hold value returned variable via sql query

instead of putting

&>> your_file.log 

behind line in

crontab -e 

try using

#!/bin/bash exec &>> your_file.log 

… @ beginning of bash script. use >> appends file rather overwriting it.


Comments

Popular posts from this blog

python - Creating a new column in a dataframe based on the result of the addition of three others -

string - Using python and postgres, variables within execute function? -