Having issues running python script via cron that executes pg_dump. Always get "permission denied". Have tried setting up .pgpass in home directory (script works at command line this way), but assume this file not found when run by cron. Have tried prepending PGPASSFILE=/path/to/.pgpass in cron in front of command, have tried modifying os.environ to include PGPASSFILE or PGPASSWORD in the script, nothing is working. Any tips? asked 27 Oct '15, 02:08 cstrombe |
I got it working! Was a simple issue, of course, related to cron. First, I had forgotten to chmod the script to make it executable, which is why I was seeing "permission denied", which I mistakenly thought was related to the postgres credentials. So, setting the password via os.environ['PGPASSWORD'] in the script is working. Thanks for the reply ryans, it's what forced me to go back and actually review my script before posting, which led me to find the issue. answered 27 Oct '15, 14:14 cstrombe |
Can you edit your question to include the code for review?