{"id":83501,"date":"2026-07-26T00:09:05","date_gmt":"2026-07-25T16:09:05","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/83501.html"},"modified":"2026-07-26T00:09:05","modified_gmt":"2026-07-25T16:09:05","slug":"linux-%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%97%a5%e5%bf%97%e8%87%aa%e5%8a%a8%e6%b8%85%e7%90%86%e6%96%b9%e6%a1%88-cron-%e5%ae%9a%e6%97%b6%e5%88%a0%e9%99%a4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/83501.html","title":{"rendered":"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664"},"content":{"rendered":"<h2>Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 &#8211; Cron \u5b9a\u65f6\u4efb\u52a1\u5b9e\u8df5<\/h2>\n<hr \/>\n<h3>\u4e00\u3001\u80cc\u666f\u95ee\u9898<\/h3>\n<p>\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u968f\u7740\u670d\u52a1\u6301\u7eed\u8fd0\u884c&#xff0c;\u65e5\u5fd7\u6587\u4ef6\u4f1a\u4e0d\u65ad\u7d2f\u79ef&#xff0c;\u5360\u7528\u5927\u91cf\u78c1\u76d8\u7a7a\u95f4\u3002\u4ee5\u67d0\u5f00\u53d1\u6d4b\u8bd5\u670d\u52a1\u5668\u4e3a\u4f8b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u65e5\u5fd7\u76ee\u5f55&#xff1a;\/data\/logs<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u6570\u91cf&#xff1a;100&#043; \u4e2a\u5fae\u670d\u52a1<\/p>\n<\/li>\n<li>\n<p>\u78c1\u76d8\u5360\u7528&#xff1a;28G<\/p>\n<\/li>\n<li>\n<p>\u5f85\u6e05\u7406\u6587\u4ef6&#xff1a;24267 \u4e2a&#xff08;\u8d85\u8fc7 7 \u5929&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u5982\u679c\u4e0d\u53ca\u65f6\u6e05\u7406&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3&#xff0c;\u5f71\u54cd\u670d\u52a1\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u65e5\u5fd7\u76ee\u5f55\u5206\u6790<\/h3>\n<h4>2.1 \u76ee\u5f55\u7ed3\u6784<\/h4>\n<p>\/data\/logs\/<br \/>\n\u251c\u2500\u2500 cas_logs\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# CAS\u8ba4\u8bc1\u670d\u52a1\u65e5\u5fd7<br \/>\n\u251c\u2500\u2500 nginx\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 # Nginx\u65e5\u5fd7<br \/>\n\u251c\u2500\u2500 ttpt_cas\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# \u5e73\u53f0CAS\u65e5\u5fd7<br \/>\n\u251c\u2500\u2500 yyzx_testservice_logs\/ \u00a0     # \u6d4b\u8bd5\u670d\u52a1\u65e5\u5fd7<br \/>\n\u251c\u2500\u2500 &#8230; (100&#043; \u670d\u52a1\u76ee\u5f55)<br \/>\n\u251c\u2500\u2500 spring.log \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 # \u6563\u843d\u7684\u65e5\u5fd7\u6587\u4ef6<br \/>\n\u2514\u2500\u2500 spring.log.2025-12-31.log<\/p>\n<h4>2.2 \u65e5\u5fd7\u6587\u4ef6\u547d\u540d\u89c4\u5219<\/h4>\n<p>\u901a\u8fc7\u5206\u6790&#xff0c;\u53d1\u73b0\u65e5\u5fd7\u6587\u4ef6\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u79cd\u547d\u540d\u683c\u5f0f&#xff1a;<\/p>\n<table>\n<tr>\u683c\u5f0f\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>\u670d\u52a1\u540d-YYYY-MM-DD-HH-\u5e8f\u53f7.log<\/td>\n<td>cas-2022-01-04-11-1.log<\/td>\n<\/tr>\n<tr>\n<td>\u670d\u52a1\u540d.log.YYYY-MM-DD.log<\/td>\n<td>ttpt_gmservice_logs.log.2026-01-08.log<\/td>\n<\/tr>\n<tr>\n<td>access_log.YYYY-MM-DD.log<\/td>\n<td>access_log.2026-01-08.log<\/td>\n<\/tr>\n<tr>\n<td>*.gz<\/td>\n<td>\u538b\u7f29\u540e\u7684\u5386\u53f2\u65e5\u5fd7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e09\u3001\u89e3\u51b3\u65b9\u6848\u8bbe\u8ba1<\/h3>\n<h4>3.1 \u6280\u672f\u65b9\u6848<\/h4>\n<p>\u4f7f\u7528 find &#043; cron \u7ec4\u5408\u5b9e\u73b0\u81ea\u52a8\u5316\u65e5\u5fd7\u6e05\u7406&#xff1a;<\/p>\n<ul>\n<li>\n<p>find \u547d\u4ee4&#xff1a;\u6309\u6587\u4ef6\u7c7b\u578b\u548c\u4fee\u6539\u65f6\u95f4\u7b5b\u9009\u65e5\u5fd7\u6587\u4ef6<\/p>\n<\/li>\n<li>\n<p>cron \u5b9a\u65f6\u4efb\u52a1&#xff1a;\u6bcf\u5929\u5b9a\u65f6\u6267\u884c\u6e05\u7406\u811a\u672c<\/p>\n<\/li>\n<li>\n<p>\u65e5\u5fd7\u8bb0\u5f55&#xff1a;\u8bb0\u5f55\u6bcf\u6b21\u6e05\u7406\u64cd\u4f5c&#xff0c;\u4fbf\u4e8e\u8ffd\u6eaf<\/p>\n<\/li>\n<\/ul>\n<h4>3.2 \u5b89\u5168\u63aa\u65bd<\/h4>\n<table>\n<tr>\u5b89\u5168\u63aa\u65bd\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u76ee\u5f55\u9650\u5236<\/td>\n<td>\u53ea\u5728 \/data\/logs \u76ee\u5f55\u4e0b\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u4ef6\u7c7b\u578b\u9650\u5236<\/td>\n<td>\u53ea\u5220\u9664 *.log\u3001*.log.*\u3001*.gz \u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u53ea\u5220\u6587\u4ef6<\/td>\n<td>\u4f7f\u7528 -type f&#xff0c;\u4e0d\u5220\u9664\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>\u65f6\u95f4\u9650\u5236<\/td>\n<td>\u53ea\u5220\u9664 7 \u5929\u524d\u7684\u6587\u4ef6&#xff08;-mtime &#043;7&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u64cd\u4f5c\u65e5\u5fd7<\/td>\n<td>\u8bb0\u5f55\u6bcf\u6b21\u6e05\u7406\u7684\u65f6\u95f4\u548c\u6587\u4ef6\u6570\u91cf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u56db\u3001\u5b9e\u65bd\u6b65\u9aa4<\/h3>\n<h4>4.1 \u521b\u5efa\u811a\u672c\u76ee\u5f55<\/h4>\n<p>mkdir -p \/data\/scripts<\/p>\n<h4>4.2 \u521b\u5efa\u6e05\u7406\u811a\u672c<\/h4>\n<p>\u521b\u5efa\u6587\u4ef6 \/data\/scripts\/clean_old_logs.sh&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\n#<br \/>\n# \u65e5\u5fd7\u6e05\u7406\u811a\u672c &#8211; \u5220\u96647\u5929\u524d\u7684\u65e5\u5fd7\u6587\u4ef6<br \/>\n# \u6bcf\u5929\u65e9\u4e0a9\u70b9\u7531cron\u5b9a\u65f6\u6267\u884c<br \/>\n#<br \/>\n# \u5b89\u5168\u63aa\u65bd&#xff1a;<br \/>\n# 1. \u53ea\u5728 \/data\/logs \u76ee\u5f55\u4e0b\u64cd\u4f5c<br \/>\n# 2. \u53ea\u5220\u9664\u65e5\u5fd7\u6587\u4ef6&#xff08;*.log, *.log.*, *.gz&#xff09;<br \/>\n# 3. \u53ea\u5220\u9664\u6587\u4ef6&#xff0c;\u4e0d\u5220\u9664\u76ee\u5f55<br \/>\n# 4. \u8bb0\u5f55\u6e05\u7406\u65e5\u5fd7<br \/>\n#<br \/>\n\u200b<br \/>\nLOG_DIR&#061;&#034;\/data\/logs&#034;<br \/>\nDAYS&#061;7<br \/>\nSCRIPT_LOG&#061;&#034;\/data\/scripts\/clean_logs_history.log&#034;<br \/>\n\u200b<br \/>\n# \u786e\u4fdd\u53ea\u5728 \/data\/logs \u76ee\u5f55\u4e0b\u64cd\u4f5c<br \/>\nif [ ! -d &#034;$LOG_DIR&#034; ]; then<br \/>\n \u00a0 \u00a0echo &#034;$(date &#039;&#043;%Y-%m-%d %H:%M:%S&#039;) &#8211; \u9519\u8bef: \u76ee\u5f55 $LOG_DIR \u4e0d\u5b58\u5728&#034; &gt;&gt; &#034;$SCRIPT_LOG&#034;<br \/>\n \u00a0 \u00a0exit 1<br \/>\nfi<br \/>\n\u200b<br \/>\n# \u8bb0\u5f55\u5f00\u59cb\u65f6\u95f4<br \/>\necho &#034;$(date &#039;&#043;%Y-%m-%d %H:%M:%S&#039;) &#8211; \u5f00\u59cb\u6e05\u7406 ${DAYS} \u5929\u524d\u7684\u65e5\u5fd7\u6587\u4ef6&#8230;&#034; &gt;&gt; &#034;$SCRIPT_LOG&#034;<br \/>\n\u200b<br \/>\n# \u7edf\u8ba1\u5c06\u8981\u5220\u9664\u7684\u6587\u4ef6\u6570\u91cf<br \/>\nCOUNT&#061;$(find &#034;$LOG_DIR&#034; -type f \\\\( -name &#034;*.log&#034; -o -name &#034;*.log.*&#034; -o -name &#034;*.gz&#034; \\\\) -mtime &#043;$DAYS 2&gt;\/dev\/null | wc -l)<br \/>\n\u200b<br \/>\n# \u5220\u9664\u65e5\u5fd7\u6587\u4ef6<br \/>\nfind &#034;$LOG_DIR&#034; -type f \\\\( -name &#034;*.log&#034; -o -name &#034;*.log.*&#034; -o -name &#034;*.gz&#034; \\\\) -mtime &#043;$DAYS -delete 2&gt;\/dev\/null<br \/>\n\u200b<br \/>\n# \u8bb0\u5f55\u5b8c\u6210<br \/>\necho &#034;$(date &#039;&#043;%Y-%m-%d %H:%M:%S&#039;) &#8211; \u6e05\u7406\u5b8c\u6210&#xff0c;\u5171\u5220\u9664 $COUNT \u4e2a\u6587\u4ef6&#034; &gt;&gt; &#034;$SCRIPT_LOG&#034;<\/p>\n<h4>4.3 \u8d4b\u4e88\u6267\u884c\u6743\u9650<\/h4>\n<p>chmod &#043;x \/data\/scripts\/clean_old_logs.sh<\/p>\n<h4>4.4 \u914d\u7f6e Cron \u5b9a\u65f6\u4efb\u52a1<\/h4>\n<p># \u6dfb\u52a0\u5b9a\u65f6\u4efb\u52a1&#xff08;\u6bcf\u5929\u65e9\u4e0a9\u70b9\u6267\u884c&#xff09;<br \/>\n(crontab -l 2&gt;\/dev\/null | grep -v &#034;clean_old_logs.sh&#034;; echo &#034;0 9 * * * \/bin\/bash \/data\/scripts\/clean_old_logs.sh&#034;) | crontab &#8211;<br \/>\n\u200b<br \/>\n# \u9a8c\u8bc1\u662f\u5426\u6dfb\u52a0\u6210\u529f<br \/>\ncrontab -l<\/p>\n<p>Cron \u8868\u8fbe\u5f0f\u8bf4\u660e&#xff1a;<\/p>\n<p>0 9 * * * \/bin\/bash \/data\/scripts\/clean_old_logs.sh<br \/>\n\u2502 \u2502 \u2502 \u2502 \u2502<br \/>\n\u2502 \u2502 \u2502 \u2502 \u2514\u2500\u2500 \u661f\u671f\u51e0 (0-7, 0\u548c7\u90fd\u8868\u793a\u5468\u65e5)<br \/>\n\u2502 \u2502 \u2502 \u2514\u2500\u2500\u2500\u2500 \u6708\u4efd (1-12)<br \/>\n\u2502 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500 \u65e5\u671f (1-31)<br \/>\n\u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u5c0f\u65f6 (0-23)<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u5206\u949f (0-59)<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u9a8c\u8bc1\u4e0e\u6d4b\u8bd5<\/h3>\n<h4>5.1 \u9884\u89c8\u5f85\u5220\u9664\u6587\u4ef6<\/h4>\n<p># \u67e5\u770b\u5c06\u88ab\u5220\u9664\u7684\u6587\u4ef6\u6570\u91cf<br \/>\nfind \/data\/logs -type f \\\\( -name &#034;*.log&#034; -o -name &#034;*.log.*&#034; -o -name &#034;*.gz&#034; \\\\) -mtime &#043;7 2&gt;\/dev\/null | wc -l<br \/>\n\u200b<br \/>\n# \u67e5\u770b\u90e8\u5206\u6587\u4ef6\u5217\u8868<br \/>\nfind \/data\/logs -type f \\\\( -name &#034;*.log&#034; -o -name &#034;*.log.*&#034; -o -name &#034;*.gz&#034; \\\\) -mtime &#043;7 2&gt;\/dev\/null | head -20<\/p>\n<h4>5.2 \u624b\u52a8\u6267\u884c\u6d4b\u8bd5<\/h4>\n<p># \u6267\u884c\u6e05\u7406\u811a\u672c<br \/>\n\/bin\/bash \/data\/scripts\/clean_old_logs.sh<br \/>\n\u200b<br \/>\n# \u67e5\u770b\u6e05\u7406\u8bb0\u5f55<br \/>\ncat \/data\/scripts\/clean_logs_history.log<br \/>\n\u200b<br \/>\n# \u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u53d8\u5316<br \/>\ndu -sh \/data\/logs<\/p>\n<h4>5.3 \u67e5\u770b Cron \u6267\u884c\u65e5\u5fd7<\/h4>\n<p># \u67e5\u770b\u7cfb\u7edf cron \u65e5\u5fd7<br \/>\ntail -f \/var\/log\/cron<br \/>\n\u200b<br \/>\n# \u67e5\u770b\u6e05\u7406\u5386\u53f2\u8bb0\u5f55<br \/>\ncat \/data\/scripts\/clean_logs_history.log<\/p>\n<hr \/>\n<h3>\u516d\u3001find \u547d\u4ee4\u8be6\u89e3<\/h3>\n<h4>6.1 \u6838\u5fc3\u53c2\u6570\u8bf4\u660e<\/h4>\n<table>\n<tr>\u53c2\u6570\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>-type f<\/td>\n<td>\u53ea\u5339\u914d\u6587\u4ef6&#xff0c;\u4e0d\u5339\u914d\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>-name &#034;*.log&#034;<\/td>\n<td>\u5339\u914d\u6587\u4ef6\u540d\u6a21\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>-o<\/td>\n<td>\u903b\u8f91\u6216&#xff0c;\u8fde\u63a5\u591a\u4e2a\u5339\u914d\u6761\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-mtime &#043;7<\/td>\n<td>\u4fee\u6539\u65f6\u95f4\u8d85\u8fc7 7 \u5929<\/td>\n<\/tr>\n<tr>\n<td>-delete<\/td>\n<td>\u5220\u9664\u5339\u914d\u7684\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>2&gt;\/dev\/null<\/td>\n<td>\u5ffd\u7565\u6743\u9650\u4e0d\u8db3\u7b49\u9519\u8bef\u4fe1\u606f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.2 \u65f6\u95f4\u53c2\u6570\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u53c2\u6570\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>-mtime &#043;7<\/td>\n<td>\u4fee\u6539\u65f6\u95f4 &gt; 7 \u5929\u524d<\/td>\n<\/tr>\n<tr>\n<td>-mtime 7<\/td>\n<td>\u4fee\u6539\u65f6\u95f4 &#061; 7 \u5929\u524d<\/td>\n<\/tr>\n<tr>\n<td>-mtime -7<\/td>\n<td>\u4fee\u6539\u65f6\u95f4 &lt; 7 \u5929\u524d&#xff08;7 \u5929\u5185&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-atime<\/td>\n<td>\u8bbf\u95ee\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>-ctime<\/td>\n<td>\u72b6\u6001\u6539\u53d8\u65f6\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u4e03\u3001\u6392\u9664\u6216\u6307\u5b9a\u76ee\u5f55\u6e05\u7406<\/h3>\n<h4>7.1 \u5982\u4f55\u6392\u9664\u67d0\u4e9b\u76ee\u5f55\u4e0d\u6e05\u7406&#xff1f;<\/h4>\n<p>\u5728 find \u547d\u4ee4\u4e2d\u6dfb\u52a0 -not -path \u53c2\u6570&#xff1a;<\/p>\n<p>find &#034;$LOG_DIR&#034; -type f \\\\<br \/>\n \u00a0 \u00a0-not -path &#034;*\/kafka-logs\/*&#034; \\\\<br \/>\n \u00a0 \u00a0-not -path &#034;*\/nginx\/*&#034; \\\\<br \/>\n \u00a0  \\\\( -name &#034;*.log&#034; -o -name &#034;*.log.*&#034; -o -name &#034;*.gz&#034; \\\\) \\\\<br \/>\n \u00a0 \u00a0-mtime &#043;$DAYS -delete<\/p>\n<h4>7.2 \u5982\u4f55\u53ea\u6e05\u7406\u7279\u5b9a\u670d\u52a1\u7684\u65e5\u5fd7&#xff1f;<\/h4>\n<p>\u4fee\u6539 LOG_DIR \u6216\u6dfb\u52a0\u8def\u5f84\u8fc7\u6ee4&#xff1a;<\/p>\n<p># \u53ea\u6e05\u7406\u7279\u5b9a\u670d\u52a1<br \/>\nLOG_DIR&#061;&#034;\/data\/logs\/yyzx_testservice_logs&#034;<br \/>\n\u200b<br \/>\n# \u6216\u4f7f\u7528\u901a\u914d\u7b26\u5339\u914d\u591a\u4e2a\u670d\u52a1<br \/>\nfind \/data\/logs\/yyzx_* -type f -name &#034;*.log&#034; -mtime &#043;7 -delete<\/p>\n<hr \/>\n<h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<p>\u672c\u65b9\u6848\u901a\u8fc7 find &#043; cron \u5b9e\u73b0\u4e86\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u81ea\u52a8\u5316\u6e05\u7406&#xff1a;<\/p>\n<table>\n<tr>\u9879\u76ee\u914d\u7f6e<\/tr>\n<tbody>\n<tr>\n<td>\u6e05\u7406\u76ee\u5f55<\/td>\n<td>\/data\/logs<\/td>\n<\/tr>\n<tr>\n<td>\u4fdd\u7559\u5929\u6570<\/td>\n<td>7 \u5929<\/td>\n<\/tr>\n<tr>\n<td>\u6267\u884c\u65f6\u95f4<\/td>\n<td>\u6bcf\u5929 09:00<\/td>\n<\/tr>\n<tr>\n<td>\u6e05\u7406\u8bb0\u5f55<\/td>\n<td>\/data\/scripts\/clean_logs_history.log<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6838\u5fc3\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u2705 \u81ea\u52a8\u5316\u6267\u884c&#xff0c;\u65e0\u9700\u4eba\u5de5\u5e72\u9884<\/li>\n<li>\u2705 \u5b89\u5168\u9650\u5236&#xff0c;\u907f\u514d\u8bef\u5220\u91cd\u8981\u6587\u4ef6<\/li>\n<li>\u2705 \u64cd\u4f5c\u7559\u75d5&#xff0c;\u4fbf\u4e8e\u95ee\u9898\u8ffd\u6eaf<\/li>\n<li>\u2705 \u914d\u7f6e\u7075\u6d3b&#xff0c;\u6613\u4e8e\u8c03\u6574\u53c2\u6570<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 &#8211; Cron \u5b9a\u65f6\u4efb\u52a1\u5b9e\u8df5\u4e00\u3001\u80cc\u666f\u95ee\u9898\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u968f\u7740\u670d\u52a1\u6301\u7eed\u8fd0\u884c&#xff0c;\u65e5\u5fd7\u6587\u4ef6\u4f1a\u4e0d\u65ad\u7d2f\u79ef&#xff0c;\u5360\u7528\u5927\u91cf\u78c1\u76d8\u7a7a\u95f4\u3002\u4ee5\u67d0\u5f00\u53d1\u6d4b\u8bd5\u670d\u52a1\u5668\u4e3a\u4f8b&#xff1a;\u65e5\u5fd7\u76ee\u5f55&#xff1a;\/data\/logs\u670d\u52a1\u6570\u91cf&#xff1a;100 \u4e2a\u5fae\u670d\u52a1\u78c1\u76d8\u5360\u7528&#xff1a;28G\u5f85\u6e05\u7406\u6587\u4ef6&#xff1a;24267 \u4e2a&#xff08;\u8d85\u8fc7 7 \u5929&#xff09;\u5982\u679c\u4e0d\u53ca\u65f6\u6e05\u7406&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3&amp;#xf<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9348,9346,9347],"topic":[],"class_list":["post-83501","post","type-post","status-publish","format-standard","hentry","category-server","tag-cron","tag-find","tag-9347"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/83501.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u4efb\u52a1\u5b9e\u8df5\u4e00\u3001\u80cc\u666f\u95ee\u9898\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u968f\u7740\u670d\u52a1\u6301\u7eed\u8fd0\u884c&#xff0c;\u65e5\u5fd7\u6587\u4ef6\u4f1a\u4e0d\u65ad\u7d2f\u79ef&#xff0c;\u5360\u7528\u5927\u91cf\u78c1\u76d8\u7a7a\u95f4\u3002\u4ee5\u67d0\u5f00\u53d1\u6d4b\u8bd5\u670d\u52a1\u5668\u4e3a\u4f8b&#xff1a;\u65e5\u5fd7\u76ee\u5f55&#xff1a;\/data\/logs\u670d\u52a1\u6570\u91cf&#xff1a;100 \u4e2a\u5fae\u670d\u52a1\u78c1\u76d8\u5360\u7528&#xff1a;28G\u5f85\u6e05\u7406\u6587\u4ef6&#xff1a;24267 \u4e2a&#xff08;\u8d85\u8fc7 7 \u5929&#xff09;\u5982\u679c\u4e0d\u53ca\u65f6\u6e05\u7406&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/83501.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T16:09:05+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83501.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/83501.html\",\"name\":\"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T16:09:05+00:00\",\"dateModified\":\"2026-07-25T16:09:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/83501.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/83501.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83501.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/83501.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u4efb\u52a1\u5b9e\u8df5\u4e00\u3001\u80cc\u666f\u95ee\u9898\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u968f\u7740\u670d\u52a1\u6301\u7eed\u8fd0\u884c&#xff0c;\u65e5\u5fd7\u6587\u4ef6\u4f1a\u4e0d\u65ad\u7d2f\u79ef&#xff0c;\u5360\u7528\u5927\u91cf\u78c1\u76d8\u7a7a\u95f4\u3002\u4ee5\u67d0\u5f00\u53d1\u6d4b\u8bd5\u670d\u52a1\u5668\u4e3a\u4f8b&#xff1a;\u65e5\u5fd7\u76ee\u5f55&#xff1a;\/data\/logs\u670d\u52a1\u6570\u91cf&#xff1a;100 \u4e2a\u5fae\u670d\u52a1\u78c1\u76d8\u5360\u7528&#xff1a;28G\u5f85\u6e05\u7406\u6587\u4ef6&#xff1a;24267 \u4e2a&#xff08;\u8d85\u8fc7 7 \u5929&#xff09;\u5982\u679c\u4e0d\u53ca\u65f6\u6e05\u7406&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/83501.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T16:09:05+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/83501.html","url":"https:\/\/www.wsisp.com\/helps\/83501.html","name":"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T16:09:05+00:00","dateModified":"2026-07-25T16:09:05+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/83501.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/83501.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/83501.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux \u670d\u52a1\u5668\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\u65b9\u6848 - Cron \u5b9a\u65f6\u5220\u9664"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=83501"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83501\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=83501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=83501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=83501"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=83501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}