G
G
gadzhi152017-04-27 16:28:04
linux
gadzhi15, 2017-04-27 16:28:04

Cron does not create a file in the project folder. How to fix?

Ubuntu 16.04. When I run the script manually, the files are created in the project folder. And when I run the cron, the files are created in the home folder. The paths in the script itself are not absolute. What's wrong with cron?

MAILTO=""
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
*/5 * * * * python3 /home/users/project/clients.py >> /home/users/log.txt

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Smithson, 2017-04-27
@Smithson

Well, you yourself understood everything :)
Cron runs from the home folder of the user on whose behalf the script runs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question