Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to detect the response of crontab timing tasks

Shulou Source: shulou.com Published: 2022-06-03 00:48:31 09月22日 Update

This article will explain in detail how to detect the response of crontab timing tasks, the content of the article is of high quality, so share it for your reference. I hope you can get something after reading this article.

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 &

2. Check whether crontab is started.

Systemctl status crond

If it doesn't start, search for how to start crontab.

3. Check the crontab log

# you need to switch root to see the log tail-f / var/log/cron

If the log is not started at the corresponding time, there is a problem.

4. Check account permissions and paths

This is the key point. Many beginners will make mistakes on this issue. Please read it carefully.

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

The above is the method to detect the response of crontab scheduled tasks, and do you get anything after reading it? If you want to know more about it, you are welcome to follow the industry information. Thank you for reading.

Tags: Tasks accounts paths logs rules checks independence detection content that is articles questions switching principles files articles novices methods time more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MariaDB Docker macOS NVidia