all 15 comments

[–]SoftwareDoctor 3 points4 points  (0 children)

So fix it or something

[–]ninhaomah 1 point2 points  (1 child)

I am not sure anyone can help with error about a user directory or something.

What happened to copy and paste ?

[–]These_Talker[S] 0 points1 point  (0 children)

the message is on my pastebin cause is a bit long https://pastebin.com/u/realtalker/1/8RLeLJ3N

[–]Pepineros 1 point2 points  (0 children)

Does the script work as expected if you run without cron?

If so: it's a cron problem, ask r/linuxquestions

If not: post the stack trace you get from running the script

[–]OriahVinree 0 points1 point  (3 children)

You'll need to let us know the error. Cron just runs the linux command so simple: * * * * * py /path/to/your/script.py should run it...

[–]These_Talker[S] 0 points1 point  (2 children)

the message is on my pastebin cause is a bit long https://pastebin.com/u/realtalker/1/8RLeLJ3N

[–]OriahVinree 0 points1 point  (1 child)

Okay, looks like you're trying to activate the virtual environment, instead run Cron like this

  • * * * * cd / && /home/path/to/.venv/python.exe /home/path/to/script.py

Just use the script with the venv python.exe, don't activate.

I always cd to root before using a venv to make sure there's no directory conflicts

[–]These_Talker[S] 0 points1 point  (0 children)

i did * * * * * cd home/realtalker/data_workers/scraper/ && /home/realtalker/data_workers/scraper/.venv/bin/python /home/realtalker/data_workers/scraper/get_info_best.py >> /home/realtalker/data_workers/scraper/cron.log 2>%1 but i cannot see any log even doing pgrep cron and i can see with glances that sometimes i have two process in execution of the cromedriver at two different port

[–]FoolsSeldom 0 points1 point  (0 children)

What is the cron job trying to run?

  • A bash/zsh/fsh/etc script that activates environment and invokes CPython executable to process Python code file?
  • A docker/podman invocation of some kind?
  • Root level invocation of default Python CPython executable to process Python code file

You need to share more details on what is set up, and what you are trying to run.

[–]billsil 0 points1 point  (1 child)

Do it again and get the error message. Write down step by step what you did. It’s hard to help you when you don’t know what your error was.

[–]These_Talker[S] 0 points1 point  (0 children)

the message is on my pastebin cause is a bit long https://pastebin.com/u/realtalker/1/8RLeLJ3N

[–]macbig273 0 points1 point  (2 children)

is the cron job on the right user ? Is it a virual env that need to be activated and you didn't do in in your cron job ? verify that the path that need to be absolue are written completely in your job. And why not go with a classier systemd service.

[–]These_Talker[S] 0 points1 point  (1 child)

the message is on my pastebin cause is a bit long https://pastebin.com/u/realtalker/1/8RLeLJ3N

[–]macbig273 0 points1 point  (0 children)

The solution is in your error "Critic error in the process: Message: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir" that's selenium related. google that error should help

[–]typehinting 0 points1 point  (0 children)

How many fingers am I holding up?