Run python script as cron job

Hi,

I have a simple python script which sets some different things around my house and home network that runs daily on my laptop. I want to get rid of my laptop (which runs ubuntu) completely.

Since I have truenas installed on a minipc, I want to run that script through it. Now, I see the cron, you can add custom command but when i put this command:

python /mnt/vol1/media/python_scripts/My_Script.py

It doesn’t really run, or I don’t see it actually do something. What the script supposed to be doing is certainly not happening.

Any potential clues or recommendations on running my py script on a schedule basis?

Thank you!

Try this way:
cd /mnt/vol1/media/python_scripts && python3 My_Script.py
Also in the cronjob you can uncheck hide standard output/ errore for a better troubleshooting

Hehe works like a charm, didn’t thought of it. Many thanks!

1 Like