0

I'm trying to setup a cron job to run a python script every hour, but it has to be run with python3.

I've tried setting up the cron to point to the python 3.6 libraries, but this doesn't seem to work.

This is how I've set it up

0 * * * * /usr/local/lib/python3.6/python3 /mnt/dietpi_userdata/python/main.py

I suspect it's something simple, but it's beyond my own (googling) skills.

1 Answers1

0

Are you sure that your python3 path is correct? If you are not using a virtual environment you could try this:

0 * * * * $(which python3) /mnt/dietpi_userdata/python/main.py

Additionally you could manually run which python3 to verify your python3 path.

medium
  • 4,136
  • 16
  • 55
  • 66
  • Thanks for the help, no, I wasn't sure, I'd never heard of the `which python3` command before. I think I've got it set-up properly now. – thekevinkalis Sep 11 '19 at 18:29