Score:1

CronJob Not running

cn flag

I have prepared a py Script to update my Django database once a day. Trying to use Crontab along with python to run the py script.

0 1 * * 4 /usr/bin/python3 /home/user/folder1/script1.py
0 2 * * * /usr/bin/python3 /home/user/folder1/folder11/script2.py

Crontab is able to run the first script without any problem. But it's not able to run the second script.

I can able to execute the second py script via the python venv environment without any error

How to read the error of this cronjob? Anyone experienced this problem, How did you solved it?

Score:2
in flag

You should redirect both standard input and standard error from the crontab execution like below:

0 2 * * * /usr/bin/python3 /home/user/folder1/folder11/script2.py > /tmp/script2.log 2>&1

Then once its failed to run have a look at the /tmp/script2.log for the reason(s).

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.