Detection steps for crontab scheduled tasks not responding

angryTom
Release: 2019-11-26 13:45:35
forward
2217 people have browsed it

Detection steps for crontab scheduled tasks not responding

Detection steps for crontab scheduled tasks not responding

1. Set rules

To prevent some path errors, use absolute paths

*/1 * * * * /home/anaconda3/bin/python3 home/mysticbiant/code/test.py >>/home/mysticbiant/test.py.log 2>&1 &
Copy after login

2. Check whether crontab is started

(Recommended learning: Linux video Tutorial)

systemctl status crond
Copy after login

Detection steps for crontab scheduled tasks not responding

If it does not start, search for yourself how to start crontab.

3. Check the crontab log

# 需要切换root才能看到日志
tail -f /var/log/cron
Copy after login

Detection steps for crontab scheduled tasks not respondingIf the log does not start at the corresponding time, there is a problem.

4. Check account permissions and paths

This is the key point. Many novices will make mistakes in this issue. Please read carefully

crontab timing The task planning rules are that one account is independent and each one does not affect the other. For example, root has its own independent scheduled task plan, and the mysticbinary sub-account you created also has its own independent scheduled task plan, so the redirection rule >>out.log you write will be generated under your corresponding account path. For example, if you use root to create a crontab scheduled task, you need to switch to /root/ to view the out.log file.

This article comes from the php Chinese website, linux system tutorial column, welcome to learn!

The above is the detailed content of Detection steps for crontab scheduled tasks not responding. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template