Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Matters needing attention when using crontab under unix

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

It is very common to use crontab timers in normal server management, but you should pay attention to a few points when using them:

1. Pay attention to the 5 * words in the crontab format. Do not make mistakes. Find a picture on the Internet that can directly identify the value of the * of crontab:

2. If sendmail is not started in the system after crontab is enabled, when the program executed in crontab has output, the output will be sent to the user in the form of e-mail, and the accumulated files will be saved in the / var/spool/clientmqueue directory. We can usually add > / dev/null 2 > & 1 to the statement with output, but sometimes there will always be omissions. Then we can use a small script to clean it up every three days.

00 1 * / 3 * * / usr/local/scripts/delmail.sh [root@test scripts] # cat delmail.shemail.Bingray BASHCD / var/spool/clientmqueue/ls | xargs rm-rvf

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report