I have the following list of tasks to complete and they are working successfully.
0 0 */1 * * bash /home/user/Code/agapov/start_GHR_Y00011285.sh >> ~/cron.log 2>&1
5 0 */1 * * bash /home/user/Code/agapov/start_GHR_Y00011280.sh >> ~/cron.log 2>&1
10 0 */1 * * bash /home/user/Code/agapov/start_GHR_Y10001320.sh >> ~/cron.log 2>&1
20 0 */1 * * bash /home/user/Code/agapov/aggregation.sh >> ~/cron.log 2>&1
25 0 */1 * * bash /home/user/Code/ivanov/start_API_N00001010.sh >> ~/cron.log 2>&1
The file structure is as follows:
#!/bin/bash
source /home/user/anaconda3/bin/activate
python /home/user/Code/agapov/GHR_Y00011280.py
conda deactivate
But then a problem arises, I added several new files for execution and they do not work. Here is an example of the code for such a file
#!/bin/bash
source /home/user/anaconda3/bin/activate
python /home/user/Code/analyzator.py
conda deactivate
As you can see, it is completely similar, the python file itself starts and does its job perfectly, but something goes wrong with the crowns
Cron logs:
/home/user/Code/start_analyzator.sh: line 4: conda: command not found
/home/user/Code/start_analyzator.sh: line 2: /home/user/anaconda3/bin/activate
: No such file or directory
/home/user/Code/start_analyzator.sh: line 3: python: command not found
bash: /home/user/Code/ivanov/start_DS_N00001400.sh: No such file or directory
/home/user/Code/start_analyzator.sh: line 4: conda: command not found
/home/user/Code/start_analyzator.sh: line 2: /home/user/anaconda3/bin/activate
: No such file or directory
/home/user/Code/start_analyzator.sh: line 3: python: command not found
/home/user/Code/start_analyzator.sh: line 4: conda: command not found
analyzator - a file that sends a message to a telegram, here are its settings for checking
*/5 * * * * bash /home/user/Code/start_analyzator.sh >> ~/cron.log 2>&1
What could be the problem, some files work fine and others don't???
question from:
https://stackoverflow.com/questions/65904501/crontab-python-script-does-not-run-with-anaconda-on-linux-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…