Score:0

Running crontab -e with the console on

am flag
Max

I'm trying to run a python script that uses Selenium to scrap a website on Startup.

After adding @reboot /Desktop/script.py to the crontab however (using crontab -e), it seems the script only works when the console is on, and since it opens the script without the console on, the script crashes.

Any ideas on how to fix that? Thanks in advance!


Edit, it opens chrome (as it should), but it doesn't work, Chrome closes automatically-

am flag
Max
That's the way I open it everyday when I restart. The full path won't work. /Desktop/script.py attempts to open Chrome, which means it's accessing the script, but since Selenium expects the console to be open, it closes itself.
Score:1
ir flag

You must supply full path to your command when defining a cronjob ... so instead of simply /Desktop/script.py give it /whatever/is/full/path/to/somescript

confirm you full path is correct by listing it from a terminal

ls -la /whatever/is/full/path/to/somescript

am flag
Max
It indeed is. And it still does the same error. Opens chrome, but fails to do what it's supposed to...
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.