Answer the question
In order to leave comments, you need to log in
How to run python script with cron?
Hello, there is such a blank:
#!/usr/bin/env python
import pynotify
def sendmessage(title, message):
pynotify.init("test")
notice = pynotify.Notification(title, message)
notice.show()
return
sendmessage('title', 'body')
chmod +x script.py
./script.py # нотификатор работает
*/1 * * * * $HOME/path/to/script.py
print 'RUN'
*/1 * * * * $HOME/path/to/script.py >> $HOME/cron.log
Answer the question
In order to leave comments, you need to log in
Here it is decided:
*/1 * * * * export DISPLAY=:0.0 && export XAUTHORITY=$HOME/.Xauthority && $HOME/path/to/script.py
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question