{"id":524,"date":"2011-01-28T00:30:38","date_gmt":"2011-12-13T13:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/calculate-eta-of-a-file-transfer\/"},"modified":"2011-01-28T00:30:38","modified_gmt":"2011-12-13T13:51:50","slug":"calculate-eta-of-a-file-transfer","status":"publish","type":"post","link":"\/blog\/index.php\/calculate-eta-of-a-file-transfer\/","title":{"rendered":"Calculate ETA of a file transfer"},"content":{"rendered":"<p>You are transferring a 7.2Gb file using scp on a wan, you want to know at some moment how much more time you will<br \/>\nhave to wait until it is transferred, i wrote a script to give an average, it must be run on the file receiving server.<br \/>\n#!\/bin\/ksh<br \/>\nFS=7343108 #&#8212; the filesize<br \/>\nf=\/app\/db\/oracle\/u01\/oracle\/rmanbackupsets\/v9jlbbu9_1_3 #&#8212; the file that is growing..<br \/>\ns1=`du -s $f |awk &#8216;{ print $1 }&#8217;`<br \/>\necho &#8220;&#8230;sleeping 10&#8221;<br \/>\nsleep 10<br \/>\ns2=`du -s $f | awk &#8216;{ print $1 }&#8217;`<br \/>\ndelta=`echo &#8220;${s2} &#8211; ${s1}&#8221; | bc`<br \/>\necho &#8220;Bytes transferred in 10 secs : $delta&#8221;<br \/>\nREMAINING=`echo &#8220;$FS &#8211; $s2&#8221; | bc`<br \/>\necho &#8220;Original Filesize : $FS&#8221;<br \/>\necho &#8220;Remaining : $REMAINING&#8221;<br \/>\nETA=`echo &#8220;scale=3;(($REMAINING \/ $delta) \/ 6)\/60&#8221; | bc`<br \/>\necho &#8220;Hours remaining for transfer $ETA&#8221;<br \/>\ndu -sh $f<br \/>\n98\/433<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You are transferring a 7.2Gb file using scp on a wan, you want to know at some moment how much more time you will have to wait until it is transferred, i wrote a script to give an average, it must be run on the file receiving server. #!\/bin\/ksh FS=7343108 #&#8212; the filesize f=\/app\/db\/oracle\/u01\/oracle\/rmanbackupsets\/v9jlbbu9_1_3 #&#8212; [&hellip;]<\/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":[],"class_list":["post-524","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=524"}],"version-history":[{"count":0,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/524\/revisions"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=524"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}