Crontab won’t run python script!!
Even if you run the python script directly in crontab, the related problems are the same.
Python’s os.system() method does not work.
If you use the automatic scheduler Crontab using Python, you should use it as below.
How to use OS.SYSTEM() method
1. Create a shell script file.
make shell-script file (execute File)
vi p.sh sudo /usr/bin/python3 /root/_PYTHON3/memcheck_httpd_restart.py df -h
2. 755 Provide administrator authority.
chmod 755 p.sh 751 or 755
3. Enter as below using the Crontab-e command.
*/1 * * * * /UserFileForderName/p.sh
It’s going to work well now.
Thank you 🙂
If you want to make an automatic script using Python, check the post below and follow it.
Look at the first article and install it.
I look at the second article and update it.