{"id":5097,"date":"2023-04-09T13:31:40","date_gmt":"2023-04-09T12:31:40","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=5097"},"modified":"2023-04-14T19:59:33","modified_gmt":"2023-04-14T18:59:33","slug":"cleanup-your-messy-backup","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=5097","title":{"rendered":"Cleanup your messy backup"},"content":{"rendered":"<p>Cleanup your messy backup by hand could be fun! Kinda of. The goal is to remove duplicated files and organize the files into a new structure.<br \/>\nFirst of all lets record the free disk space over time.<br \/>\nConsider this script which collects the free space over time in a file:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ cat freespace.sh \r\ndate | tr  '\\n' ' ' | tee -a freespace_overtime\r\ndf -h . | tail -n 1 | tee -a freespace_overtime\r\n\r\n$ cat freespace_overtime \r\nSun 09 Apr 2023 08:24:59 AM CEST \/dev\/sdb1      1008G  779G  178G  82% \/mnt\r\n<\/pre>\n<p>Now lets try to find some things like local Qt and boost installations, check the downloads\/ and opt\/ folders,  .Trash\/  .wine build\/ .hg .svg git .local .cache .mozilla .dropbox java .steam bin\/  , linux- kernel source, other obsolete downloads and delete them. Also check for hidden directories and hidden files...<\/p>\n<hr>\n<p>Local Qt installation are usually in the folder \"QtSDK\" or \"Qt-*\". The -prune option tell find to stop the recursion when find a matching folder.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;QtSDK*&quot; -prune \r\n.\/backup\/kater_12.01.2018\/kater\/QtSDK\r\n\r\nfind . -type d -iname &quot;Qt-*&quot; -prune\r\n.\/backup\/kater_12.01.2018\/kater\/Qt-1.6.0\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;*.java*&quot; -prune\r\n<\/pre>\n<p>6GB good start<\/p>\n<hr>\n<p>Find boost installations<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ find . -type d -iname &quot;boost*&quot; -prune \r\n.\/backup\/kater_12.01.2018\/kater\/download\/boost_1_64_0\r\n<\/pre>\n<p>Almost 1GB for me.<\/p>\n<hr>\n<p>Usually there is a lot of stuff in the downloads folder which can be removed<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ find . -type d -iname &quot;*download*&quot; -prune\r\n<\/pre>\n<p>Cleaned up 14GB!<\/p>\n<hr>\n<p>More obsolete stuff in opt\/ folders.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;opt&quot; -prune\r\n<\/pre>\n<p>Only 1GB this time.<\/p>\n<hr>\n<p>Find trash bins.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;*trash*&quot; \r\n.\/.Trash-1000\r\n.\/backup\/backup_80GB_HDD\/backup_festrechner_13.03.2012\/kater\/.local\/share\/Trash\r\n<\/pre>\n<p>5GB Trash... Be aware don't delete your regular backup files. Because there is no other backup ;)<\/p>\n<hr>\n<p>Old wine folders can be interesting. ...<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;.wine&quot; -prune\r\n<\/pre>\n<p>But not this time.<\/p>\n<hr>\n<p>Finding old build folders result in a lot of false positives.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ find . -type d -iname &quot;*build*&quot; -prune\r\n<\/pre>\n<p>2GB for me.<\/p>\n<hr>\n<p>Old Mercurial hidden folders. Delete them all!<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ find . -type d -iname &quot;.hg&quot; -prune\r\n<\/pre>\n<hr>\n<p>And old subversion folders too. Gosch I have over 200 of them<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;.svn&quot; -prune |   xargs rm -fr\r\n<\/pre>\n<hr>\n<p>Don't forget to delete the git folders too! They should be in the cloud anyway ;)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;.git&quot; -prune\r\n<\/pre>\n<p>Wow 11GB. Guess I deleted some other things too XD<\/p>\n<hr>\n<p>Nicht wirklich was zu holen bei .local.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n find . -type d -iname &quot;.local&quot; -prune\r\n<\/pre>\n<hr>\n<p>Immerhin 1GB bei .cache<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;.cache&quot; -prune\r\n<\/pre>\n<hr>\n<p>Nur 700MB. Weg damit. Wenn da was wichtiges gespeichert w\u00e4re, h\u00e4tte man es an anderer Stelle nochmal gespeichert.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;.mozilla&quot; -prune\r\n<\/pre>\n<hr>\n<p>Dropbox haha als sich \"Cloud\" anfing durchzusetzen.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n find . -type d -iname &quot;*dropbox*&quot; -prune\r\n<\/pre>\n<hr>\n<p>Haha Java weine ich keiner Tr\u00e4ne nach<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;*.java*&quot; -prune\r\n<\/pre>\n<hr>\n<p>Mit Steam ist das eigentlich so eine Sache, aber auf der anderen Seite kann man alles neu runterladen. Man hat es ja gekauft...<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;*.steam&quot; -prune\r\n<\/pre>\n<p>1.3GB!<\/p>\n<hr>\n<p>Unglaublich was sich so alles in bin\/ Ordner versteckt.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -type d -iname &quot;bin&quot; -prune\r\n<\/pre>\n<p>Immerhin 6GB.<\/p>\n<hr>\n<p>Versteckte Ordner sind ja auch so einen Sache von denen man nichts wei\u00df und ergo auch nicht braucht.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ find \/mnt -type d -iname &quot;.*&quot; -prune\r\n<\/pre>\n<p>Das waren auch ein paar GB...<\/p>\n<hr>\n<p>Und versteckte Dateien erst. Was sich da an M\u00fcll ansammelt<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ find \/mnt -type f -iname &quot;.*&quot; -prune\r\n<\/pre>\n<hr>\n<p>Diese dummen autoerstellen thumbnail Dateien k\u00f6nnen auch weg. <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -iname &quot;thumbs.db&quot; -print0 | xargs -0 du -ch\r\n<\/pre>\n<p>Nur 40MB aber M\u00fcll ist M\u00fcll.<\/p>\n<hr>\n<p>Beim erstellen von Half Life Maps entstanden fr\u00fcher jeden Menge M\u00fclldatein beim compilieren. Diese haben die Endung  p0 p1 p2 p3 prt pts wic lin max und k\u00f6nnen nach kurzer Sichtung alle gel\u00f6scht werden.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nfind . -iname &quot;*.p0&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.p1&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.p2&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.p3&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.prt&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.pts&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.wic&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.lin&quot; -print0 | xargs -0 du -ch\r\nfind . -iname &quot;*.max&quot; -print0 | xargs -0 du -ch\r\n<\/pre>\n<p>Bei den .prt Datein hat sich _EINE_ Datei aus NFSp reingemogelt die nicht gel\u00f6scht werden sollte.<br \/>\nKanpp 1k Datei und 62M.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cleanup your messy backup by hand could be fun! Kinda of. The goal is to remove duplicated files and organize the files into a new structure. First of all lets record the free disk space over time. Consider this script which collects the free space over time in a file: $ cat freespace.sh date | [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-5097","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/5097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5097"}],"version-history":[{"count":10,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/5097\/revisions"}],"predecessor-version":[{"id":5105,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/5097\/revisions\/5105"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5097"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}