How To Get Cron Job To Pick up ~/.my.cnf
My question is how do I get a cron job to pick up the user's ~/.my.cnf? If the user runs the shell script, everything is fine. The cron entry has the same user run the job, and I've tried #!/bin/bash -l in the shell script with no success.
Here are the details:
I have a bash shell script that launches a Python program.
The python program issues an external shell mysql -e command.
I don't want the python code to use use -u user-name -pMyPassword, db-name, because this is contained in ~/.my.cnf. The python code doesn't have to use these parameters if run interactively, but does have to if run from cron.
I'm trying to find out why.
Thanks in advance for any help.