

{"id":819,"date":"2015-12-02T17:15:28","date_gmt":"2015-12-02T08:15:28","guid":{"rendered":"https:\/\/curecode.jp\/tech\/?p=819"},"modified":"2015-12-02T17:15:28","modified_gmt":"2015-12-02T08:15:28","slug":"tar-file-changed-as-we-read-it-warning","status":"publish","type":"post","link":"https:\/\/curecode.jp\/tech\/tar-file-changed-as-we-read-it-warning\/","title":{"rendered":"tar \u306e &#8220;file changed as we read it&#8221; \u30a8\u30e9\u30fc\u306e\u56de\u907f\u65b9\u6cd5"},"content":{"rendered":"<p>\ntar \u30b3\u30de\u30f3\u30c9\u3067\u30a2\u30fc\u30ab\u30a4\u30d6\u3059\u308b\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u4e2d\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u5909\u66f4\u3055\u308c\u308b\u3068\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002\n<\/p>\n<p>\n\u305f\u3068\u3048\u3070cron\u3067\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u4e2d\u306b<\/p>\n<pre><code class=\"bash\">\r\ntar: var\/log\/test.log: file changed as we read it\r\n<\/code><\/pre>\n<p>\n\u306e\u3088\u3046\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002\u65e5\u672c\u8a9e\u74b0\u5883\u3060\u3068\n<\/p>\n<pre><code class=\"bash\">\r\ntar: var\/log\/test.log: \u8aad\u307f\u8fbc\u3093\u3060\u30d5\u30a1\u30a4\u30eb\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u307e\u3059\r\n<\/code><\/pre>\n<p>\n\u3068\u3044\u3046\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u307e\u3059\u3002\n<\/p>\n<p>\n  \u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6291\u6b62\u3059\u308b\u306b\u306f\u3001tar \u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u6642\u306b <code>--warning=no-file-changed<\/code> \u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\n<\/p>\n<pre><code class=\"bash\">\r\ntar czvf test.tar test.log --warning=no-file-changed\r\n<\/code><\/pre>\n<p>\n\u540c\u69d8\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u524a\u9664\u3055\u308c\u305f\u3068\u304d\u306b\u306f\n<\/p>\n<pre><code class=\"bash\">\r\ntar: File removed before we read it\r\n<\/code><\/pre>\n<p>\n\u3068\u3044\u3046\u30ef\u30fc\u30cb\u30f3\u30b0\u304c\u51fa\u307e\u3059\u306e\u3067 <code>--warning=no-file-removed<\/code> \u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u308c\u3070\u6291\u6b62\u3067\u304d\u307e\u3059\u3002\n<\/p>\n<p>\n\u307e\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306a\u3069\u3067\u5207\u308a\u6368\u3066\u3089\u308c\u305f\u3068\u304d\u306b\u306f\u3001\n<\/p>\n<pre><code class=\"bash\">\r\ntar: test.log: 67700368 \u30d0\u30a4\u30c8\u5c0f\u3055\u304f\u306a\u3063\u305f\u306e\u3067\u3001\u30bc\u30ed\u3067\u57cb\u3081\u307e\u3059\r\n<\/code><\/pre>\n<pre><code class=\"bash\">\r\ntar: test.log: File shrank by 111937258 bytes; padding with zeros\r\n<\/code><\/pre>\n<p>\n\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u307e\u3059\u306e\u3067\u3001<code>--warning=no-file-shrank<\/code> \u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\n<\/p>\n<pre><code class=\"bash\">\r\ntar czvf test.tar test.log --warning=no-file-changed --warning=no-file-removed --warning=no-file-shrank\r\n<\/code><\/pre>\n<p>\n\u4e0a\u8a18\u306e\u3088\u3046\u306b\u8907\u6570\u6307\u5b9a\u3059\u308b\u306e\u304c\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\n<\/p>\n<p>\n\u305f\u3060\u3057\u3001\u4e0a\u8a18\u306e\u6307\u5b9a\u306f\u30ef\u30fc\u30cb\u30f3\u30b0\u3092\u6d88\u3059\u3060\u3051\u3067\u3001tar \u30b3\u30de\u30f3\u30c9\u306e\u623b\u308a\u5024\u306f 1 \u306e\u307e\u307e\u3067\u3059\u3002\n<\/p>\n<p>\n\u56de\u907f\u7b56\u3068\u3057\u3066\u306f\u3001tar \u30b3\u30de\u30f3\u30c9\u306f\u81f4\u547d\u7684\u306a\u30a8\u30e9\u30fc\u3067\u306f 2 \u304c\u623b\u308a\u307e\u3059\u306e\u3067\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306a\u3069\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u4e2d\u3067\u306f\u623b\u308a\u5024 0, 1 \u306f\u51e6\u7406\u7d9a\u884c\u3068\u3057\u3066\u6271\u3046\u306a\u3069\u306e\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002\n<\/p>\n<pre class=\"code\"><code class=\"bash\">\r\ntar czvf example.tar.gz \/var\/log\/httpd --warning=no-file-changed --warning=no-file-removed --warning=no-file-shrank\r\ncode=$?\r\nif [ $code -ne 0 -a $code -ne 1 ]; then\r\n        echo \"Fatal Error\"\r\n        exit $code\r\nfi\r\n<\/code><\/pre>\n<h3>IT\u30a8\u30f3\u30b8\u30cb\u30a2\u52df\u96c6\u4e2d\uff01<\/h3>\n<p>\u30ad\u30e5\u30a2\u30b3\u30fc\u30c9\u682a\u5f0f\u4f1a\u793e\u306fIT\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u52df\u96c6\u3057\u3066\u304a\u308a\u307e\u3059\u3002\u5c11\u4eba\u6570\u306e\u8077\u5834\u306a\u306e\u3067\u3001\u4e0a\u6d41\u30fb\u4e0b\u6d41\u3084\u30b5\u30fc\u30d0\u30fc\u30fb\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5bfe\u5fdc\u306e\u57a3\u6839\u306a\u304f\u3001\u3042\u306a\u305f\u306e\u5f37\u307f\u3092\u6d3b\u304b\u3057\u306a\u304c\u3089 \u3044\u308d\u3044\u308d\u306a\u3053\u3068\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u53ef\u80fd\u3067\u3059\u3002\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u306e\u672a\u7d4c\u9a13\u306e\u65b9\u3001\u7d4c\u9a13\u304c\u5c11\u306a\u3044\u65b9\u3082\u6b53\u8fce\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u3088\u308aIT\u30a8\u30f3\u30b8\u30cb\u30a2\u52df\u96c6\u306e\u63a1\u7528\u60c5\u5831\u3092\u3054\u89a7\u3044\u305f\u3060\u3051\u307e\u3059\u3002<\/p>\n<div class=\"curecode_recruit_bn\">\n\t\t\t\t<a href=\"https:\/\/curecode.jp\/recruit\/itengineer\/\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/curecode.jp\/tech\/wp-content\/themes\/tech\/images\/it_recruit.png?20241220\" alt=\"\u4e8b\u696d\u62e1\u5927\u306b\u4f34\u3044\u65b0\u3057\u3044\u9818\u57df\u306b\u4e00\u7dd2\u306b\u53d6\u308a\u7d44\u3093\u3067\u3044\u304f\u30e1\u30f3\u30d0\u30fc\u3092\u52df\u96c6\u3057\u307e\u3059\u3002\"  width=\"500\" height=\"180\"\/><br \/>\n\t\t\t\t<\/a>\n\t\t<\/div>\n<h3>\u30ad\u30e5\u30a2\u30b3\u30fc\u30c9\u516c\u5f0f\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0<\/h3>\n<p>\u30ad\u30e5\u30a2\u30b3\u30fc\u30c9\u682a\u5f0f\u4f1a\u793e\u306e\u65b0\u30b5\u30fc\u30d3\u30b9\u60c5\u5831\u3084\u3001\u30aa\u30d5\u30a3\u30b9\u30e9\u30a4\u30d5\u306e\u7d20\u6575\u306a\u77ac\u9593\u307e\u3067\u3002\u79c1\u305f\u3061\u306e\u65e5\u3005\u306e\u55b6\u307f\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div class=\"curecode_recruit_bn\">\n\t\t\t\t<a href=\"https:\/\/www.instagram.com\/curecode\/\" target=\"_blank\" rel=\"noopener noreferrer\"><br \/>\n\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/curecode.jp\/tech\/wp-content\/themes\/tech\/images\/insta_bn.png?20241220\" alt=\"\u4e8b\u696d\u62e1\u5927\u306b\u4f34\u3044\u65b0\u3057\u3044\u9818\u57df\u306b\u4e00\u7dd2\u306b\u53d6\u308a\u7d44\u3093\u3067\u3044\u304f\u30e1\u30f3\u30d0\u30fc\u3092\u52df\u96c6\u3057\u307e\u3059\u3002\"  width=\"500\" height=\"180\"\/><br \/>\n\t\t\t\t<\/a>\n\t\t<\/div>\n","protected":false},"excerpt":{"rendered":"<p>tar \u30b3\u30de\u30f3\u30c9\u3067\u30a2\u30fc\u30ab\u30a4\u30d6\u3059\u308b\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u4e2d\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u5909\u66f4\u3055\u308c [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":592,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[47],"class_list":["post-819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-tar"],"_links":{"self":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/comments?post=819"}],"version-history":[{"count":7,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts\/819\/revisions"}],"predecessor-version":[{"id":837,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/posts\/819\/revisions\/837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/media\/592"}],"wp:attachment":[{"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/media?parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/categories?post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/curecode.jp\/tech\/wp-json\/wp\/v2\/tags?post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}