R
R
reqww2020-06-10 17:19:43
linux
reqww, 2020-06-10 17:19:43

Why is crontab not working?

I am trying to periodically rewrite an HTML file using a simple script and a function in python, writing there every minute the current time the nginx server is running.
The problem is that if you run the script via bash, then everything is perfectly rewritten, but for some reason it does not want to rewrite the file via cron.
What could be the problem?
PS All this is happening on a remote virtual machine that I connected to via PuTTy.

Now more specifically.
In cron I have the following written:
5ee0ebc112bc9364082117.png
This is the time.sh file:
In time.sh it is written:

!#/bin/bash
sudo python3 update

update - python function
5ee0eb24ad8eb932230097.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2020-06-10
@reqww

Write full paths everywhere: to python, to file

R
rionnagel, 2020-06-10
@rionnagel

Crontabs are different. What do you edit and how? Through crontab -e or /etc/crontab? In /etc/crontab you need to specify the user, through crontab -e - no. Path variables are best avoided.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question