'New to linux: permission Denied, How to read the output file after a cronjob is run?

I have a simply cron job that reads a hello.py file in virtual environment. The file basically says print " hello world". The cron job runs this file every minute and posts the output in a text file called " a.txt".

My cron job is as follows:


* * * * * /shared/index_scrapes/.venv/bin /shared/index_scrapes/hello.py >> /shared/index_scrapes/a.txt  2>&1

I can see the output file a.txt in my directory but when i try to read it by using the following command:

cat a.txt

I am getting the following error:

enter image description here

I have even tried making the file executable:

chmod u+x hello.py

Please help!



Solution 1:[1]

I think you really cat your a.txt. Just the a.txt content is an error message!

You have a permission issue with /shared/index_scrapes/.venv/bin that generate the permission denied error text in a.txt.

Fix the permission to /shared/index_scrapes/.venv/bin and it will do the job

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alaindeseine