{"id":275,"date":"2010-11-17T18:25:43","date_gmt":"2010-11-17T17:25:43","guid":{"rendered":"http:\/\/webpiraten.de\/?p=275"},"modified":"2010-11-17T18:25:43","modified_gmt":"2010-11-17T17:25:43","slug":"mit-find-und-xargs-alte-dateien-loschen","status":"publish","type":"post","link":"https:\/\/webpiraten.de\/index.php\/server\/mit-find-und-xargs-alte-dateien-loschen\/","title":{"rendered":"mit find und xargs alte dateien l\u00f6schen"},"content":{"rendered":"<p>Der Konsolen Befehl im Detail:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nfind . -type f -ctime +3 -maxdepth 1 | xargs rm\r\n<\/pre>\n<p><strong>find .<\/strong> findet im aktuellen Ordner Dateien (<strong>-type f<\/strong> &#8211; files) deren Dateistatus vor mehr als 3*24h (<strong>-ctime +3<\/strong>) ge\u00e4ndert wurde. Mit <strong>-maxdepth 1<\/strong> verhindern wir Rekursion in die Tiefe des aktuellen Ordners.<\/p>\n<p>Die Pipe (<strong>|<\/strong>) \u00fcbergibt das find-Ergebnis nach <strong>xargs<\/strong> und f\u00fchrt <strong>rm <\/strong>auf jedem einzelnen Ergebnis aus.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Der Konsolen Befehl im Detail: find . -type f -ctime +3 -maxdepth 1 | xargs rm find . findet im aktuellen Ordner Dateien (-type f &#8211; files) deren Dateistatus vor mehr als 3*24h (-ctime +3) ge\u00e4ndert wurde. Mit -maxdepth 1 verhindern wir Rekursion in die Tiefe des aktuellen Ordners. Die Pipe (|) \u00fcbergibt das find-Ergebnis [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77,75,54,76],"tags":[203,144,196,201,202,96,93,204,205,91],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-deployment","category-linux","category-server","category-shell","tag-alte-dateien","tag-bash","tag-console","tag-ctime","tag-delete","tag-find","tag-loschen","tag-maxdepth","tag-type","tag-xargs"],"_links":{"self":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":1,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":276,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/275\/revisions\/276"}],"wp:attachment":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/media?parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/categories?post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/tags?post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}