I have added cronjob -e with below-
* * * * * /usr/bin/python3 /home/user/test.py
But the cronjob is failing everytime. I can test the script while running normally and its working fine.
The cron is required to run every minute and have tested with echo and redirecting output to a file and that works perfectly fine. After trying with both user & root in separate instance it didn't work. I have check the syslog and here is what i can see-
May 20 06:30:01 ubuntu CRON[2145]: (user) CMD (/usr/bin/python3 /home/user/test.py)
May 20 06:30:01 ubuntu CRON[2144]: (CRON) info (No MTA installed, discarding output)
May 20 06:31:01 ubuntu CRON[2148]: (user) CMD (/usr/bin/python3 /home/user/test.py)
May 20 06:31:02 ubuntu CRON[2147]: (CRON) info (No MTA installed, discarding output)
May 20 06:31:29 ubuntu crontab[2150]: (user) BEGIN EDIT (user)
May 20 06:31:37 ubuntu crontab[2150]: (user) REPLACE (user)
May 20 06:31:37 ubuntu crontab[2150]: (user) END EDIT (user)
May 20 06:31:46 ubuntu crontab[2162]: (root) BEGIN EDIT (root)
May 20 06:31:54 ubuntu crontab[2162]: (root) REPLACE (root)
May 20 06:31:54 ubuntu crontab[2162]: (root) END EDIT (root)
May 20 06:32:01 ubuntu cron[862]: (root) RELOAD (crontabs/root)
May 20 06:32:01 ubuntu cron[862]: (user) RELOAD (crontabs/user)
May 20 06:32:01 ubuntu CRON[2177]: (user) CMD (/usr/bin/python3 /home/user/test.py)
May 20 06:32:01 ubuntu CRON[2178]: (root) CMD (/usr/bin/python3 /home/user/test.py)
May 20 06:32:01 ubuntu CRON[2175]: (CRON) info (No MTA installed, discarding output)
May 20 06:32:01 ubuntu CRON[2176]: (CRON) info (No MTA installed, discarding output)
May 20 06:33:01 ubuntu CRON[2183]: (user) CMD (/usr/bin/python3 /home/user/test.py)
May 20 06:33:01 ubuntu CRON[2184]: (root) CMD (/usr/bin/python3 /home/user/test.py)
May 20 06:33:01 ubuntu CRON[2182]: (CRON) info (No MTA installed, discarding output)
May 20 06:33:01 ubuntu CRON[2181]: (CRON) info (No MTA installed, discarding output)
Can't able to figure out what this MTA means here. Read is some forum mailx installation is required as this is a bug. there is no direct mailx installation support on 16.04 may be older version supported it.
Your help is highly appreciated here. Please help me with your inputs.
Thanks,