I have set up my crontab so it executes my python script every day (for testing purposes I set it to every minute) however the cron tab ignores most of the code
so i tested a bit in order to find where exactly does the script stop:
If i put a print statement at the top of the script it will write the output in my logfile - perfect
If i put a print statement in line of the script it will also print into the logfile - perfect
however if i have some other code in there it will suddendly stop and do nothing else, for example in this case 0 and 1 gets printed out but 2 does not
print(0)
print(1)
import sys
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
import os
import datetime
from bs4 import BeautifulSoup
import re
print(2)
the same problem also occures with other code not just import statements
by the way this is my code in root crontab
* * * * * /usr/bin/python3 /abc/def/script.py >> /var/log/cron.log