run python script as cronjob

Tim K

New member
Joined
Feb 17, 2025
Messages
3
Hi,
is it possible - and if so, how - to run a python script as a cronjob? I kind of figured out how to set up a python application, but that's not what i want - i want to process some data collected online on a regular basis, using python modules like geopy and pyproj.
Any suggestions? Thanks in advance, best,
T.
 
put the full binary file path in the cronjob config same as execute PHP.

Example:
Code:
/usr/bin/python /home/<user>/myscript.py
 
Thanks! But this gets me
"/bin/sh: /usr/bin/python: No such file or directory", and i'm not sure where to set up the python version and install the modules etc. for this.
 
ah thanks!
for further reference:
1. set up a python app with application root 'bin'
2. in Putty console: 'which python'
gives:
~/virtualenv/bin/3.11/bin/python
then:
virtualenv/bin/3.11/bin/python cronjobs/xyz.py
that did it
 
Back
Top