I have to schedule some tasks for which I invoke a shell script in my home directory. I try to run a python script from this Shell script but it doesn't work.
I have tried the following till now.
Shell script code
#!/bin/sh
python3 /absolute path/to/file/myfile.py >> log_script.txt
I was finally able to solve this question thanks to get the good suggestion provided here https://www.bejarano.io/fixing-cron-jobs-in-mojave/, cron needs to be provided disk access, it seems, it doesn't have disk access by default, as a side not make sure to also allow terminal to have full disk access
Simply add the following to full disk access under,
System Settings > Privacy & Security > Full Disk Access
/usr/sbin/cron