{"id":3378,"date":"2018-04-27T11:26:09","date_gmt":"2018-04-27T03:26:09","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=3378"},"modified":"2018-04-27T11:26:09","modified_gmt":"2018-04-27T03:26:09","slug":"centos7%e7%9a%84tmp%e7%9b%ae%e5%bd%95%e8%87%aa%e5%8a%a8%e6%b8%85%e7%90%86%e8%a7%84%e5%88%99","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/hemanual\/centos7%e7%9a%84tmp%e7%9b%ae%e5%bd%95%e8%87%aa%e5%8a%a8%e6%b8%85%e7%90%86%e8%a7%84%e5%88%99\/","title":{"rendered":"CentOS7\u7684tmp\u76ee\u5f55\u81ea\u52a8\u6e05\u7406\u89c4\u5219"},"content":{"rendered":"<article>\n<div id=\"article_content\" class=\"article_content csdn-tracking-statistics tracking-click\">\n<div class=\"htmledit_views\">\n<p>CentOS6\u4ee5\u4e0b\u7cfb\u7edf\uff08\u542b\uff09\u4f7f\u7528watchtmp + cron\u6765\u5b9e\u73b0\u5b9a\u65f6\u6e05\u7406\u4e34\u65f6\u6587\u4ef6\u7684\u6548\u679c\uff0c\u8fd9\u70b9\u5728CentOS7\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u5728CentOS7\u4e0b\uff0c\u7cfb\u7edf\u4f7f\u7528systemd\u7ba1\u7406\u6613\u53d8\u4e0e\u4e34\u65f6\u6587\u4ef6\uff0c\u4e0e\u4e4b\u76f8\u5173\u7684\u7cfb\u7edf\u670d\u52a1\u67093\u4e2a\uff1a<\/p>\n<pre><code class=\"language-bash hljs\">systemd-tmpfiles-setup.service  \uff1aCreate Volatile Files and Directories\r\nsystemd-tmpfiles-setup-dev.service\uff1aCreate static device nodes <span class=\"hljs-keyword\">in<\/span> \/dev\r\nsystemd-tmpfiles-clean.service \uff1aCleanup of Temporary Directories<\/code><\/pre>\n<p>\u76f8\u5173\u7684\u914d\u7f6e\u6587\u4ef6\u4e5f\u67093\u4e2a\u5730\u65b9\uff1a<\/p>\n<pre><code class=\"language-bash hljs\">\/etc\/tmpfiles.d\/*.conf\r\n\/run\/tmpfiles.d\/*.conf\r\n\/usr\/lib\/tmpfiles.d\/*.conf<\/code><\/pre>\n<p>\/tmp\u76ee\u5f55\u7684\u6e05\u7406\u89c4\u5219\u4e3b\u8981\u53d6\u51b3\u4e8e\/usr\/lib\/tmpfiles.d\/tmp.conf\u6587\u4ef6\u7684\u8bbe\u5b9a\uff0c\u9ed8\u8ba4\u7684\u914d\u7f6e\u5185\u5bb9\u4e3a\uff1a<\/p>\n<pre><code class=\"language-bash hljs\"><span class=\"hljs-comment\">#  This file is part of systemd.<\/span>\r\n<span class=\"hljs-comment\">#<\/span>\r\n<span class=\"hljs-comment\">#  systemd is free software; you can redistribute it and\/or modify it<\/span>\r\n<span class=\"hljs-comment\">#  under the terms of the GNU Lesser General Public License as published by<\/span>\r\n<span class=\"hljs-comment\">#  the Free Software Foundation; either version 2.1 of the License, or<\/span>\r\n<span class=\"hljs-comment\">#  (at your option) any later version.<\/span>\r\n\r\n<span class=\"hljs-comment\"># See tmpfiles.d(5) for details<\/span>\r\n\r\n<span class=\"hljs-comment\"># Clear tmp directories separately, to make them easier to override<\/span>\r\nv \/tmp 1777 root root 10d           <span class=\"hljs-comment\">#   \u6e05\u7406\/tmp\u4e0b10\u5929\u524d\u7684\u76ee\u5f55\u548c\u6587\u4ef6<\/span>\r\nv \/var\/tmp 1777 root root 30d       <span class=\"hljs-comment\">#   \u6e05\u7406\/var\/tmp\u4e0b30\u5929\u524d\u7684\u76ee\u5f55\u548c\u6587\u4ef6<\/span>\r\n\r\n<span class=\"hljs-comment\"># Exclude namespace mountpoints created with PrivateTmp=yes<\/span>\r\nx \/tmp\/systemd-private-%b-*\r\nX \/tmp\/systemd-private-%b-*\/tmp\r\nx \/var\/tmp\/systemd-private-%b-*\r\nX \/var\/tmp\/systemd-private-%b-*\/tmp<\/code><\/pre>\n<p>\u6211\u4eec\u53ef\u4ee5\u914d\u7f6e\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6bd4\u5982\u4f60\u4e0d\u60f3\u8ba9\u7cfb\u7edf\u81ea\u52a8\u6e05\u7406\/tmp\u4e0b\u4ee5tomcat\u5f00\u5934\u7684\u76ee\u5f55\uff0c\u90a3\u4e48\u589e\u52a0\u4e0b\u9762\u8fd9\u6761\u5185\u5bb9\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\u5373\u53ef\uff1a<\/p>\n<pre><code class=\"language-bash hljs\">x \/tmp\/tomcat.*<\/code><\/pre>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>CentOS6\u4ee5\u4e0b\u7cfb\u7edf\uff08\u542b\uff09\u4f7f\u7528watchtmp + cron\u6765\u5b9e\u73b0\u5b9a\u65f6\u6e05\u7406\u4e34\u65f6\u6587\u4ef6\u7684\u6548\u679c\uff0c\u8fd9\u70b9\u5728CentOS &#8230; <a title=\"CentOS7\u7684tmp\u76ee\u5f55\u81ea\u52a8\u6e05\u7406\u89c4\u5219\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/hemanual\/centos7%e7%9a%84tmp%e7%9b%ae%e5%bd%95%e8%87%aa%e5%8a%a8%e6%b8%85%e7%90%86%e8%a7%84%e5%88%99\/\" aria-label=\"\u9605\u8bfb CentOS7\u7684tmp\u76ee\u5f55\u81ea\u52a8\u6e05\u7406\u89c4\u5219\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,49,5],"tags":[495,118],"class_list":["post-3378","post","type-post","status-publish","format-standard","hentry","category-hemanual","category-linux","category-jishu","tag-centos7-x","tag-tmp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=3378"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3378\/revisions"}],"predecessor-version":[{"id":3379,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3378\/revisions\/3379"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=3378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=3378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=3378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}