I'm running a Python feedparser script via cron job on a Centos6 remote server (SSHing into the server).
In Crontab, this is my cron job:
MAILTO = [email protected]
*/10 * * * * /home/local/COMPANY/malvin/SilverChalice_CampusInsiders/SilverChalice_CampusInsiders.py > /home/local/COMPANY/malvin/SilverChalice_CampusInsiders`date +\%Y-\%m-\%d-\%H:\%M:\%S`-cron.log | mailx -s "Feedparser Output" [email protected]
However, I'm seeing this message in the email that's being sent, which should just contain the output of the script:
Null message body; hope that's ok
/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Traceback (most recent call last):
File "/home/local/COMPANY/malvin/SilverChalice_CampusInsiders/SilverChalice_CampusInsiders.py", line 70, in <module>
BC_01.createAndIngest(name, vUrl, tags, desc)
File "/home/local/COMPANY/malvin/SilverChalice_CampusInsiders/BC_01.py", line 69, in createAndIngest
creds = loadSecret()
File "/home/local/COMPANY/malvin/SilverChalice_CampusInsiders/BC_01.py", line 17, in loadSecret
credsFile=open('brightcove_oauth.json')
IOError: [Errno 2] No such file or directory: 'brightcove_oauth.json'
Normally, this would be a no-brainer issue: something must be wrong with my code. Except, the script works perfectly fine when I run it on the command line via python SilverChalice_CampusInsiders.py
What am I doing wrong here? Why doesn't the Python script "see" the json oauth file when run via cron job?