{"id":289928,"date":"2024-02-11T21:17:35","date_gmt":"2024-02-11T13:17:35","guid":{"rendered":"https:\/\/lrxjmw.cn\/ldsrwrzyhqsg.html"},"modified":"2024-02-11T21:17:35","modified_gmt":"2024-02-11T13:17:35","slug":"ldsrwrzyhqsg","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ldsrwrzyhqsg.html","title":{"rendered":"Linux\u5b9a\u65f6\u4efb\u52a1\u65e5\u5fd7\u4f18\u5316\uff0c\u8f7b\u677e\u7ba1\u7406\u4efb\u52a1\u6267\u884c\u72b6\u51b5"},"content":{"rendered":"
\u5728\u65e5\u5e38\u670d\u52a1\u5668\u7ba1\u7406\u65f6\uff0c\u65f6\u5e38\u78b0\u5230\u9700\u8981\u5b9a\u65f6\u8fd0\u884c\u67d0\u4e9b\u4efb\u52a1\u7684\u9700\u6c42\uff0c\u56e0\u6b64\u5bf9\u4e8e\u8fd9\u4e9b\u5b9a\u65f6\u4efb\u52a1\u7684\u8fd0\u884c\u72b6\u51b5\u8fdb\u884c\u6e05\u6670\u8bb0\u5f55\u5c31\u663e\u5f97\u5c24\u4e3a\u91cd\u8981\uff0c\u8fd9\u5c06\u5bf9\u540e\u671f\u7684\u68c0\u67e5\u53ca\u4f18\u5316\u4ea7\u751f\u5f88\u5927\u5e2e\u52a9\u3002\u672c\u6587\u6211\u4eec\u6765\u804a\u4e0b\u5982\u4f55\u4f18\u5316Linux<\/a>\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u65e5\u5fd7\uff0c\u4f7f\u60a8\u80fd\u66f4\u9ad8\u6548\u5730\u7ba1\u7406\u4e0e\u76d1\u63a7\u7535\u8111\u4e2d\u7684\u5b9a\u65f6\u4efb\u52a1\u3002<\/p>\n 1.\u786e\u5b9a\u65e5\u5fd7\u8def\u5f84\u548c\u683c\u5f0f<\/b><\/p>\n \u9996\u5148\uff0c\u8bf7\u8003\u8651\u9009\u62e9\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u65e5\u5fd7\u5b58\u50a8\u4f4d\u7f6e\u53ca\u683c\u5f0f\u3002\u6b63\u5e38\u6765\u8bb2\uff0c\u5efa\u8bae\u4ee5\u7279\u5b9a\u6587\u4ef6\u4f5c\u4e3a\u5b58\u50a8\u5a92\u4ecb\uff0c\u4e14\u91c7\u7528\u901a\u7528\u7684\u683c\u5f0f\u6765\u8be6\u7ec6\u8bb0\u5f55\u4efb\u52a1\u7684\u6267\u884c\u72b6\u51b5\u3002\u6bd4\u5982\uff0c\u5c06\u65e5\u5fd7\u5b58\u653e\u5728\/var\/log\/cron\u6b64\u76ee\u5f55linux\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u65e5\u5fd7<\/strong>\uff0c\u540c\u65f6\u91c7\u7528\u4f17\u6240\u5468\u77e5\u7684syslog\u683c\u5f0f\u6765\u8fdb\u884c\u8bb0\u5f55\u5373\u53ef\u3002<\/p>\n 2.\u8bbe\u7f6e\u5408\u9002\u7684\u65e5\u5fd7\u7ea7\u522b<\/b><\/p>\n \u4e3a\u4fbf\u4e8e\u540e\u671f\u5206\u6790\u548c\u7b5b\u9009\uff0c\u6211\u4eec\u53ef\u6309\u4efb\u52a1\u91cd\u8981\u7a0b\u5ea6\u8bbe\u5b9a\u76f8\u5e94\u7684\u65e5\u5fd7\u7b49\u7ea7\u5206\u7c7b\u3002\u5bf9\u5173\u952e\u4efb\u52a1\uff0c\u5efa\u8bae\u4f7f\u7528\u8f83\u9ad8\u7684\u7ea7\u522b\uff08\u5982Error\u6216Critical\uff09\u8bb0\u5f55\uff0c\u5bf9\u65e5\u5e38\u4efb\u52a1\uff0c\u5219\u53ef\u9009\u8f83\u4f4e\u7ea7\u522b\u7684\u8bbe\u7f6e(\u5982Info\u6216Debug)\u3002\u5982\u6b64\u4e00\u6765\uff0c\u6211\u4eec\u4fbf\u80fd\u6709\u6548\u5730\u5229\u7528\u7ea7\u522b\u8fc7\u6ee4\u65e5\u5fd7\uff0c\u63d0\u5347\u5de5\u4f5c\u6548\u7387\u54e6\uff01<\/p>\n 3.\u6dfb\u52a0\u65f6\u95f4\u6233<\/b><\/p>\n \u4e3a\u63d0\u9ad8\u4efb\u52a1\u8ddf\u8e2a\u6548\u7387\uff0c\u6211\u4eec\u5efa\u8bae\u60a8\u4e3a\u6bcf\u4e2a\u65e5\u5fd7\u7eaa\u5f55\u6ce8\u5165\u51c6\u786e\u7684\u65f6\u95f4\u6233\u4fe1\u606f\uff0c\u4fbf\u4e8e\u7cbe\u51c6\u638c\u63e1\u4efb\u52a1\u7684\u8fd0\u884c\u65f6\u523b\u4e0e\u6240\u9700\u65f6\u957f\u3002\u53ef\u901a\u8fc7\u4f7f\u7528date\u547d\u4ee4<\/a>\u8f7b\u677e\u83b7\u53d6\u5f53\u524d\u65f6\u95f4\u5e76\u6dfb\u52a0\u5165\u65e5\u5fd7\u8bb0\u5f55\u4e4b\u4e2d\u3002<\/p>\n <\/p>\n 4.\u8bb0\u5f55\u5173\u952e\u4fe1\u606f<\/b><\/p>\n \u9664\u65f6\u95f4\u6233\u5916\uff0c\u6211\u4eec\u4e5f\u4f1a\u5728\u6b64\u65e5\u5fd7\u4e2d\u914d\u9001\u5176\u4ed6\u6838\u5fc3\u8be6\u60c5\uff0c\u4ee5\u8f85\u52a9\u672a\u6765\u7684\u6df1\u5165\u7814\u7a76\u3002\u6bd4\u5982\u4efb\u52a1\u540d\u79f0\u3001\u6267\u884c\u6210\u679c\u3001\u9519\u8bef\u8baf\u606f\u7b49\u7b49\uff0c\u8fd9\u4e9b\u90fd\u80fd\u5e2e\u60a8\u66f4\u6e05\u6670\u5730\u628a\u63e1\u4efb\u52a1\u8fdb\u5ea6\uff0c\u53ca\u65f6\u89e3\u51b3\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898\u54e6\uff01<\/p>\n 5.\u4f7f\u7528\u5408\u9002\u7684\u65e5\u5fd7\u5de5\u5177<\/b><\/p>\n <\/p>\n \u4e3a\u4e86\u66f4\u6709\u6548\u5730\u7ba1\u7406\u5e76\u67e5\u770b\u5b9a\u65f6\u4efb\u52a1\u7684\u8fd0\u4f5c\u72b6\u51b5\uff0c\u5efa\u8bae\u60a8\u5c1d\u8bd5\u4ee5\u4e0b\u4e13\u4e1a\u5de5\u5177\uff1a\u5229\u7528logrotate\uff0c\u6211\u4eec\u80fd\u591f\u5b9a\u671f\u8c03\u6574\u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f\u4ee5\u9632\u5de8\u5927\u7684\u6d88\u8017\uff1b\u901a\u8fc7\u8fd0\u7528grep\u6216awk\u6307\u4ee4\uff0c\u6211\u4eec\u53ef\u6328\u4e2a\u68c0\u7d22\u5173\u952e\u8bcd\u6216\u8005\u6df1\u5165\u5206\u6790\u65e5\u5fd7\u4fe1\u606f\uff0c\u4ee5\u6b64\u4e86\u89e3\u7279\u5b9a\u4efb\u52a1\u7684\u8868\u73b0\u4ee5\u53ca\u4efb\u52a1\u7684\u6267\u884c\u9891\u7387\u4e0e\u9700\u8981\u65f6\u95f4\u7684\u5e73\u5747\u503c\u7b49\u5173\u952e\u6570\u636e\u3002<\/p>\n 6.\u5b9a\u65f6\u6e05\u7406\u65e0\u7528\u65e5\u5fd7<\/b><\/p>\n \u4e3a\u9632\u6b62\u670d\u52a1\u5668\u5b58\u50a8\u7a7a\u95f4\u8017\u5c3d\uff0c\u9700\u5b9a\u671f\u6e05\u7406\u65e0\u7528\u7684\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u65e5\u5fd7\u3002\u60a8\u53ef\u542f\u7528cron\u5b9a\u65f6\u4efb\u52a1\u6765\u81ea\u52a8\u6e05\u7406\u65e7\u65e5\u5fd7\u5e76\u4fdd\u5b58\u8fd1\u671f\u8bb0\u5f55\u3002<\/p>\n 7.\u8bbe\u7f6e\u544a\u8b66\u673a\u5236<\/b><\/p>\n