{"id":4838,"date":"2016-09-17T16:39:57","date_gmt":"2016-09-17T15:39:57","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=4838"},"modified":"2016-09-17T16:39:57","modified_gmt":"2016-09-17T15:39:57","slug":"save-gigabytes-of-failed-rsync-video-transfers-on-a-drive","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/save-gigabytes-of-failed-rsync-video-transfers-on-a-drive\/","title":{"rendered":"Save Gigabytes of Failed Rsync Video Transfers on a Drive"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_4838\" class=\"pvc_stats all  \" data-element-id=\"4838\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>If you watch and keep a lot of YouTube or other video files, and backup regularly from your main laptop to other PCs, you may accumulate a lot of partial videos from interrupted copies and \u00a0rsync transfers that have extensions of the type .crdload or .MOV_0002.mp4.B8ObyK which can accumulate to a surprising size.<\/p>\n<p>Running find for mp4 files of these types on my 1.5TB backup drive I found many which I could then approximately sum (ignoring k values as most are in MB, but if you want accuracy, drop the -h to show 1K-blocks) via:<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/ -name *.mp4.* -exec du -h {} +; | awk '{sum +=$1} {print $1, sum}'<\/span><br \/>\n<span style=\"color: #ff0000;\">221M 221<\/span><br \/>\n<span style=\"color: #ff0000;\">571M 792<\/span><br \/>\n<span style=\"color: #ff0000;\">539M 1331<\/span><br \/>\n<span style=\"color: #ff0000;\">91M 1422<\/span><br \/>\n<span style=\"color: #ff0000;\">....<\/span><br \/>\n<span style=\"color: #ff0000;\">221M 7218.3<br \/>\n580M 7798.3<br \/>\n422M 8220.3<br \/>\n37M <strong>8257.3<\/strong><\/span><\/p>\n<p>This is about 8GB of useless video files!<\/p>\n<p>Run:<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/ -name *.mp4.*<\/span><\/p>\n<p>Make sure you check the files before you\u00a0remove them with -exec <strong>rm<\/strong>!!<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/ -name *.mp4.* -exec rm --i=no {} +;<\/span><\/p>\n<p>Because if you ran the same line for mp3s you may delete important non MP3 files such as:<\/p>\n<p><span style=\"color: #ff0000;\">100K \/Quadra\/www\/wp\/wp-includes\/ID3\/module.audio<strong>.mp3.php<\/strong><\/span><\/p>\n<p>Out of interest, as I have a large vid collection, I could measure it approximately as 177GB!:<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/Quadra\/ -name *.mp4 -exec du -h {} +; | awk '{sum +=$1} {print $1, sum}'<\/span><\/p>\n<p><span style=\"color: #ff0000;\">175M 176824<\/span><br \/>\n<span style=\"color: #ff0000;\">382M <strong>177206<\/strong><\/span><\/p>\n<p>OR as MB:<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/Quadra\/ -name *.mp4 -exec du -Bm {} +; | awk '{sum +=$1} {print $1, sum \"M\"}'<\/span><\/p>\n<p><span style=\"color: #ff0000;\">382M <strong>188597M<\/strong><\/span><\/p>\n<p>If you want MB accuracy converted to GB:<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/Quadra\/ -name *.mp4 -exec du -Bm {} +; | awk '{sum +=$1} {print $1MB, sum \"MB\", sum\/1024 \"GB\"}'<\/span><\/p>\n<p><span style=\"color: #ff0000;\">175M 157937MB 154.235GB<\/span><br \/>\n<span style=\"color: #ff0000;\">382M 158319MB 154.608GB<\/span><\/p>\n<p>or<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/Quadra\/ -name *.mp3 -exec du -Bk {} +; | awk '{sum +=$1} {print $1KB, sum \"KB\", sum\/1024 \"MB\", sum\/(1024*1024)\"GB\"}'<\/span><\/p>\n<p>If you test what find actually calculates when used by default without with a glob or specific name etc. with -exec du, it includes the parent directory size also.<\/p>\n<p>As a test, create 2 empty text files with touch in an empty dir Public, then add a character as in the Bits to Gb in 200 years Post, which we know is 1 byte in size, but uses a 4k block space on disk:<\/p>\n<p>stevee@T3400 ~\/Pictures $ <span style=\"color: #0000ff;\">cd<\/span><br \/>\nstevee@T3400 ~ $ cd Public\/<br \/>\nstevee@T3400 ~\/Public $<span style=\"color: #0000ff;\"> ls<\/span><br \/>\nstevee@T3400 ~\/Public $<span style=\"color: #0000ff;\"> touch test1.txt test2.txt<\/span><br \/>\nstevee@T3400 ~\/Public $ <span style=\"color: #0000ff;\">ls -l<\/span><br \/>\ntotal 0<br \/>\n-rw-r--r-- 1 stevee stevee 0 Feb 8 22:24 test1.txt<br \/>\n-rw-r--r-- 1 stevee stevee 0 Feb 8 22:24 test2.txt<br \/>\nstevee@T3400 ~\/Public $<span style=\"color: #0000ff;\"> ls -las<\/span><br \/>\ntotal 8<br \/>\n4 drwxr-xr-x 2 stevee stevee 4096 Feb 8 22:24 .<br \/>\n4 drwxr-xr-x 39 stevee stevee 4096 Feb 8 19:40 ..<br \/>\n0 -rw-r--r-- 1 stevee stevee 0 Feb 8 22:24 test1.txt<br \/>\n0 -rw-r--r-- 1 stevee stevee 0 Feb 8 22:24 test2.txt<br \/>\nstevee@T3400 ~\/Public $ <span style=\"color: #0000ff;\">echo -n \"A\" &gt;&gt; test1.txt<\/span><br \/>\nstevee@T3400 ~\/Public $ <span style=\"color: #0000ff;\">ls -las<\/span><br \/>\ntotal 12<br \/>\n4 drwxr-xr-x 2 stevee stevee 4096 Feb 8 22:24 .<br \/>\n4 drwxr-xr-x 39 stevee stevee 4096 Feb 8 19:40 ..<br \/>\n<span style=\"color: #ff0000;\"><strong>4 -rw-r--r-- 1 stevee stevee 1 Feb 8 22:25 test1.txt<\/strong><\/span><br \/>\n<span style=\"color: #ff0000;\"><strong>0 -rw-r--r-- 1 stevee stevee 0 Feb 8 22:24 test2.txt<\/strong><\/span><br \/>\nstevee@T3400 ~\/Public $ <span style=\"color: #0000ff;\">echo -n \"A\" &gt;&gt; test2.txt<\/span><br \/>\nstevee@T3400 ~\/Public $<span style=\"color: #0000ff;\"> ls -las<\/span><br \/>\ntotal 16<br \/>\n4 drwxr-xr-x 2 stevee stevee 4096 Feb 8 22:24 .<br \/>\n4 drwxr-xr-x 39 stevee stevee 4096 Feb 8 19:40 ..<br \/>\n<span style=\"color: #ff0000;\">4 -rw-r--r-- 1 stevee stevee 1 Feb 8 22:25 test1.txt<\/span><br \/>\n<span style=\"color: #ff0000;\">4 -rw-r--r-- 1 stevee stevee 1 Feb 8 22:25 test2.txt<\/span><br \/>\nstevee@T3400 ~\/Public $<span style=\"color: #0000ff;\"> find -exec du -Bk {} +; | awk '{sum +=$1} {print $1, sum \"K\"}'<\/span><br \/>\n<strong><span style=\"color: #ff0000;\">12K 12K<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">4K 16K<\/span><\/strong><br \/>\n<strong><span style=\"color: #ff0000;\">4K 20K<\/span><\/strong><\/p>\n<p>The text files only add to 8k but the total shown by find\/exec\/du includes the parent dir size.<\/p>\n<p>Without the specific file type search, you get parent dir sizes also:<\/p>\n<p>stevee@T3400 ~\/Public $ <span style=\"color: #0000ff;\">find *txt -exec du -Bk {} +; | awk '{sum +=$1} {print $1, sum \"K\"}'<\/span><br \/>\n<span style=\"color: #ff0000;\">4K 4K<\/span><br \/>\n<span style=\"color: #ff0000;\">4K 8K<\/span><br \/>\nstevee@T3400 ~\/Public $ <span style=\"color: #0000ff;\">find . -exec du -Bk {} +; | awk '{sum +=$1} {print $1 \"k\", sum \"k\"}'<\/span><br \/>\n<span style=\"color: #ff0000;\">12Kk 12k<\/span><br \/>\n<span style=\"color: #ff0000;\">4Kk 16k<\/span><br \/>\n<span style=\"color: #ff0000;\">4Kk <strong>20k\u00a0<\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_4838\" class=\"pvc_stats all  \" data-element-id=\"4838\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>If you watch and keep a lot of YouTube or other video files, and backup regularly from your main laptop to other PCs, you may accumulate a lot of partial videos from interrupted copies and \u00a0rsync transfers that have extensions of the type .crdload or .MOV_0002.mp4.B8ObyK which can accumulate to a surprising size. Running find <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/save-gigabytes-of-failed-rsync-video-transfers-on-a-drive\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Save Gigabytes of Failed Rsync Video Transfers on a Drive<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-4838","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/4838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=4838"}],"version-history":[{"count":0,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/4838\/revisions"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=4838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=4838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=4838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}