Score:0

cronjob not firing

ru flag

I must be doing something ridiculously wrong here, but I'm not seeing it.

I want to run:

python3 /home/web/Code/python/hourly-script.py

Which runs from the command fine, it displays a notification popup.

In crontab -e I put:

* * * * * python3 /home/web/Code/python/hourly-script.py

To test it running, I should get a popup every 1 minute. I dont get any popups.

From the command line, when I run grep CRON /var/log/syslog I get:

Dec 17 07:44:01 web-XPS-15-9570 CRON[16643]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)
Dec 17 07:45:02 web-XPS-15-9570 CRON[16879]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)
Dec 17 07:46:01 web-XPS-15-9570 CRON[17114]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)
Dec 17 07:47:01 web-XPS-15-9570 CRON[17489]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)
Dec 17 07:48:01 web-XPS-15-9570 CRON[17988]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)
Dec 17 07:49:01 web-XPS-15-9570 CRON[18287]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)
Dec 17 07:50:01 web-XPS-15-9570 CRON[18544]: (web) CMD (python3 /home/web/Code/python/hourly-script.py)

Which would indicate that its running every minute, so why am I not seeing a popup?

I'm running on ubuntu. The python file itself is executable:

-rwxrwxr-x 1 web web 148 Dec 17 07:34 hourly-script.py

vanadium avatar
cn flag
Does this answer your question? [How to call zenity from cron script?](https://askubuntu.com/questions/85612/how-to-call-zenity-from-cron-script)
Score:1
cn flag

The cronjob is in fact firing, but as my limited research goes (running a Minecraft server with cron), cronjobs do not output to the default CLI, TTY or GUI. To get the output, you need to give the popup a location to pop up, which will be the GUI. This probably needs to be done in your script, although I do not know how.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.