Search code examples
pythonshellcronpython-requestscron-task

Cron not running shell program stored on desktop


I am trying to run a shell (.sh file) program that will then run a python script making requests from a website. The python program outputs a file containing json data to my desktop and I would like this to run at 10AM Monday-Friday.

This is my .sh shell file. It runs correctly when executed manually from from terminal:

#!/bin/sh
python tester.py

This is what I have been using to test the shell. This would run every minute and produce my output file but it is not working:

* * * * * /path/to/file/test.sh && ./test.sh

I have tried a couple other syntax combinations as follows:

* * * * * sh /path/to/file 
* * * * * sh /path/to/file/test.sh && sh test.sh

I am aware the correct notation for a program running at 10am mon-fri would be:

0 10 * * 1-5

Nothing seems to be working and I am at a complete loss.. Any help would be greatly appreciated.


Solution

  • It ended up being my cron did not have full disk access. I was able to change this in