{"id":927,"date":"2010-07-18T21:20:16","date_gmt":"2010-07-18T19:20:16","guid":{"rendered":"http:\/\/raftaman.net\/?p=927"},"modified":"2021-05-15T11:46:40","modified_gmt":"2021-05-15T09:46:40","slug":"wordpress-backupwordpress-plugin-produces-tarballs-containing-duplicates","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=927","title":{"rendered":"BackUpWordPress plugin produces tarballs containing duplicates"},"content":{"rendered":"<p>I&#8217;m using <a href=\"http:\/\/wordpress.designpraxis.at\/plugins\/backupwordpress\/\">BackUpWordPress<\/a> to do regular database and file tree backups of this blog. Unfortunately, there is a nasty bug in this plugin which may cause the tarball to contain every backuped file multiple times (to be precise, every file except the first one will go into the tarball exactly three times).<\/p>\n<p>The problem is that the <code>.<\/code> and <code>..<\/code> directories may appear in a somewhat random order and not necessarily as the first entries in a directory. This is probably host specific (I encountered this error for the first time after I relocated this blog to another server).<\/p>\n<p>To fix <a href=\"http:\/\/wordpress.org\/extend\/plugins\/backupwordpress\/\">BackUpWordPress v0.4.5<\/a>, locate line 103 in <strong>Directory.php<\/strong> (resides in <code>wp-content\/plugins\/backupwordpress\/Archive\/Reader\/<\/code>) and change the while-loop inside the<strong> next()<\/strong> function<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n...\r\n        while ($this-&gt;source === null ||\r\n              ($error = $this-&gt;source-&gt;next()) !== true) {\r\n...\r\n<\/pre>\n<p>like this<\/p>\n<pre class=\"brush: php; highlight: [2,4]; title: ; notranslate\" title=\"\">\r\n...\r\n        $file = null; \r\n        while ($this-&gt;source === null ||\r\n              $file == '.' || $file == '..' || \r\n              ($error = $this-&gt;source-&gt;next()) !== true) {\r\n...\r\n<\/pre>\n<p>Alternatively, you can use the following patch:<\/p>\n<pre class=\"brush: diff; title: ; notranslate\" title=\"\">\r\n--- Directory.php.orig\t2010-07-17 15:02:56.093238736 +0200\r\n+++ Directory.php\t2010-07-17 15:04:10.367237641 +0200\r\n@@ -103,0 +104 @@\r\n+        $file = null; \r\n\r\n@@ -104,0 +106 @@\r\n+              $file == '.' || $file == '..' || \r\n\r\n<\/pre>\n<p>Resources:<br \/>\n<a href=\"http:\/\/pear.php.net\/bugs\/bug.php?id=6546\">http:\/\/pear.php.net\/bugs\/bug.php?id=6546<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using BackUpWordPress to do regular database and file tree backups of this blog. Unfortunately, there is a nasty bug in this plugin which may cause the tarball to contain every backuped file multiple times (to be precise, every file except the first one will go into the tarball exactly three times). The problem is that the . and &#8230;.. <a href=\"https:\/\/possiblelossofprecision.net\/?p=927\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,3],"class_list":["post-927","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-php","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=927"}],"version-history":[{"count":9,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/927\/revisions"}],"predecessor-version":[{"id":2680,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/927\/revisions\/2680"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}