2
Good morning. I’m having a problem with a python program I did. What happens is that when I run my program from the command line with this command it works normal :
python3 /home/linaro/programa/main.py > /home/linaro/log.txt &
then I did the following program on . sh
#!/bin/sh
ps -C 'python3 /home/linaro/programa/main.py' > /dev/null
if [ $? = 0 ]
then
// programa rodando
else
//echo "Iniciando o programa" > /home/linaro/log.txt
python3 /home/linaro/programa/main.py > /home/linaro/log.txt
fi
when run by it the program also works but when I include this command in crontab this way:
* * * * * root /home/linaro/gerente.sh
my program starts running, enters memory and works a few seconds and simply stops without error or leaving memory.
could someone help me generate a file that controls the execution of my python program if mine is wrong ? or would have some hint on how to make it work ?
It is not clear enough the problem, If the program stops, as it remains in memory?
– nosklo
the functioning of it , this is the functions that it should perform are not done. but the process is still in memory.
– Jasar Orion
If the process is crashing, there must be something wrong with the code that’s stopping it..
– nosklo