Hot answers tagged

5

You've run into a well-known limitation with cron. The question has been asked and answered here many times. This recent example highlights the two (at least two) choices you have: use cron (older, simpler) use systemd (newer, more complex) The answer to your question in the context of cron usage is this: If your script runs from the command line, but ...


4

I think you are missing a shebang in the beginning of your python script. Please write #!/usr/bin/env python for python2 or #!/usr/bin/env python3 for python3 as a first line of your .py file. Alternatively you can write your cronjob command as python /path/to/your/script.py (or python3) to specify directly what to use to run your script. If you put all the ...


3

I tried sunwait, mentioned above, but found it to be a bit clunky. I rewrote a similar program, myself, called heliocron, with the advantages being that it is actively maintained, has clear documentation and even has prebuilt binaries that run on Raspberry Pis off the bat. A basic command might look something like: 0 2 * * * heliocron --latitude 51.4769N --...


1

Yes. At least for now you need to specify either python or python3. At some point, python a.k.a Python ver 2.7.16 may be deprecated, and removed from the Raspbian distribution. But when this will happen has been the subject of speculation for some time. For now, python is version 2, and may be determined as follows: $ python -V Python 2.7.16 This, as ...


Only top voted, non community-wiki answers of a minimum length are eligible