{"id":3697,"date":"2015-09-05T19:38:17","date_gmt":"2015-09-06T00:38:17","guid":{"rendered":"http:\/\/www.filecloud.com\/blog\/?page_id=3697"},"modified":"2022-12-15T06:35:59","modified_gmt":"2022-12-15T12:35:59","slug":"network-file-transfer-with-on-the-fly-compression","status":"publish","type":"page","link":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/","title":{"rendered":"Network File Transfer with SCP Compression On-The-Fly"},"content":{"rendered":"<h1>Network File Transfer With On-the-fly Compression<\/h1>\n<p>We often transfer large number and large size files over the network from one computer to another. FTP is the default choice for\u00a0 transferring few files and SCP is the typical choice for transferring large number of files.<\/p>\n<p>If you happen to transfer files from one computer to another over a slow network(such as copying files from home computer to office or vice versa) then the following tip might be helpful. This technique works as follows:<br \/>\n1) Performs on-the-fly compression of files at source computer.<br \/>\n2) Transfer the compressed files over the network.<br \/>\n3) Performs on-the-fly decompression of the files at the target computer.<br \/>\nThis technique uses just SSH and TAR commands without creating any temporary files.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example<\/strong><\/span><br \/>\nLet us assume source computer as HostA and target computer as HostB. We need to transfer a directory (\/data\/files\/) with large number of files from HostA to HostB.<br \/>\n<em>1)<\/em> <span style=\"text-decoration: underline;\"><em>Command without on-the-fly compression<\/em><\/span><br \/>\nRun this command on HostB<br \/>\n<em> # scp -r HostA:\/data\/files \/tmp\/<br \/>\n<\/em>This command recursively copies \/data\/files directory from HostA to HostB<\/p>\n<p><em>2) <span style=\"text-decoration: underline;\">Command with on-the-fly compression<\/span><\/em><br \/>\nRun this command from on HostB<br \/>\n<em> # ssh HostA \u201ccd \/data\/;tar zcf \u2013 files\u201d | tar\u00a0 zxf \u2013<br \/>\n<\/em>This command recursively copies \/data\/files from HostA to HostB a lot faster on slow network.<\/p>\n<p>Let us take a\u00a0 look at this command <em>in detail:<br \/>\n1)<strong> ssh HostA <\/strong>\u201ccd \/data\/;tar zcf \u2013 files\u201d | tar\u00a0 zxf \u2013\u00a0 :<\/em> From HostB connect to HostA via SSH.<br \/>\n2) <em>ssh HostA \u201c<strong>cd \/data\/<\/strong>;tar zcf \u2013 files\u201d | tar\u00a0 zxf \u2013\u00a0 : <\/em>On HostA switch to directory \/data\/<br \/>\n3) <em>ssh HostA \u201ccd \/data\/;<strong>tar zcf \u2013 files<\/strong>\u201d | tar\u00a0 zxf \u2013 : <\/em>Tar \u2018files\u2019 directory with compression and send the output to STDOUT.<br \/>\n4) <em>ssh HostA \u201ccd \/data\/;tar zcf \u2013 files\u201d <\/em><strong>|<\/strong><em> tar\u00a0 zxf \u2013 : <\/em>Pipe(|) STDOUT from HostA to STDIN of HostB.<br \/>\n5) <em>ssh HostA \u201ccd \/data\/;tar zcf \u2013 files\u201d | <strong>tar\u00a0 zxf \u2013 <\/strong>: <\/em>On HostB decompress and untar data coming in through STDIN.<\/p>\n<p>To show how useful this technique is, we transferred 45M worth of files from HostA to HostB over a DSL connection. Here are the results:<br \/>\n1) No compression method: <strong>12min 59 sec<\/strong><br \/>\n2) On-the-fly compression method: <strong>2min 33 sec<\/strong><\/p>\n<p>This method will be effective with uncompressed large files or directories with a mix of different files. If the transferred files are already compressed then this method won\u2019t be effective.<\/p>\n<p><a href=\"\/ftp-replacement-for-filetransfer\/\">If you are looking for a secure FTP replacement, click here to learn more about FileCloud \u2013 a modern alternative to FTP. <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Network File Transfer With On-the-fly Compression We often transfer large number and large size files over the network from one computer to another. FTP is the default choice for\u00a0 transferring few files and SCP is the typical choice for transferring large number of files. If you happen to transfer files from one computer to another [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.13 (Yoast SEO v20.13) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Network File Transfer with SCP On-The-Fly: Save your time<\/title>\n<meta name=\"description\" content=\"Network file transfer with SCP on-the-fly Compression would save time. The most common method for transferring large number of files data over a slow network.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Network File Transfer with SCP Compression On-The-Fly\" \/>\n<meta property=\"og:description\" content=\"Network file transfer with SCP on-the-fly Compression would save time. The most common method for transferring large number of files data over a slow network.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/\" \/>\n<meta property=\"og:site_name\" content=\"FileCloud blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/tonidopage\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-15T12:35:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.filecloud.com\/blog\/wp-content\/uploads\/2023\/05\/FC-OG-image.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"551\" \/>\n\t<meta property=\"og:image:height\" content=\"289\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@getfilecloud\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/\",\"url\":\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/\",\"name\":\"Network File Transfer with SCP On-The-Fly: Save your time\",\"isPartOf\":{\"@id\":\"https:\/\/www.filecloud.com\/blog\/#website\"},\"datePublished\":\"2015-09-06T00:38:17+00:00\",\"dateModified\":\"2022-12-15T12:35:59+00:00\",\"description\":\"Network file transfer with SCP on-the-fly Compression would save time. The most common method for transferring large number of files data over a slow network.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.filecloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Network File Transfer with SCP Compression On-The-Fly\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.filecloud.com\/blog\/#website\",\"url\":\"https:\/\/www.filecloud.com\/blog\/\",\"name\":\"FileCloud blog\",\"description\":\"Topics on Private cloud, On-Premises, Self-Hosted, Enterprise File Sync and Sharing\",\"publisher\":{\"@id\":\"https:\/\/www.filecloud.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.filecloud.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.filecloud.com\/blog\/#organization\",\"name\":\"FileCloud\",\"url\":\"https:\/\/www.filecloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.filecloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.filecloud.com\/blog\/wp-content\/uploads\/2016\/02\/filecloud_logo_comparison.jpg\",\"contentUrl\":\"https:\/\/www.filecloud.com\/blog\/wp-content\/uploads\/2016\/02\/filecloud_logo_comparison.jpg\",\"width\":155,\"height\":40,\"caption\":\"FileCloud\"},\"image\":{\"@id\":\"https:\/\/www.filecloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/tonidopage\",\"https:\/\/twitter.com\/getfilecloud\",\"https:\/\/www.linkedin.com\/company\/codelathe\",\"https:\/\/www.pinterest.com\/filecloud\/filecloud\/\",\"https:\/\/www.youtube.com\/channel\/UCbU5gTFdNCPESA5aGipFW6g\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Network File Transfer with SCP On-The-Fly: Save your time","description":"Network file transfer with SCP on-the-fly Compression would save time. The most common method for transferring large number of files data over a slow network.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/","og_locale":"en_US","og_type":"article","og_title":"Network File Transfer with SCP Compression On-The-Fly","og_description":"Network file transfer with SCP on-the-fly Compression would save time. The most common method for transferring large number of files data over a slow network.","og_url":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/","og_site_name":"FileCloud blog","article_publisher":"https:\/\/www.facebook.com\/tonidopage","article_modified_time":"2022-12-15T12:35:59+00:00","og_image":[{"width":551,"height":289,"url":"https:\/\/www.filecloud.com\/blog\/wp-content\/uploads\/2023\/05\/FC-OG-image.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@getfilecloud","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/","url":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/","name":"Network File Transfer with SCP On-The-Fly: Save your time","isPartOf":{"@id":"https:\/\/www.filecloud.com\/blog\/#website"},"datePublished":"2015-09-06T00:38:17+00:00","dateModified":"2022-12-15T12:35:59+00:00","description":"Network file transfer with SCP on-the-fly Compression would save time. The most common method for transferring large number of files data over a slow network.","breadcrumb":{"@id":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.filecloud.com\/blog\/network-file-transfer-with-on-the-fly-compression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.filecloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Network File Transfer with SCP Compression On-The-Fly"}]},{"@type":"WebSite","@id":"https:\/\/www.filecloud.com\/blog\/#website","url":"https:\/\/www.filecloud.com\/blog\/","name":"FileCloud blog","description":"Topics on Private cloud, On-Premises, Self-Hosted, Enterprise File Sync and Sharing","publisher":{"@id":"https:\/\/www.filecloud.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.filecloud.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.filecloud.com\/blog\/#organization","name":"FileCloud","url":"https:\/\/www.filecloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.filecloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.filecloud.com\/blog\/wp-content\/uploads\/2016\/02\/filecloud_logo_comparison.jpg","contentUrl":"https:\/\/www.filecloud.com\/blog\/wp-content\/uploads\/2016\/02\/filecloud_logo_comparison.jpg","width":155,"height":40,"caption":"FileCloud"},"image":{"@id":"https:\/\/www.filecloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/tonidopage","https:\/\/twitter.com\/getfilecloud","https:\/\/www.linkedin.com\/company\/codelathe","https:\/\/www.pinterest.com\/filecloud\/filecloud\/","https:\/\/www.youtube.com\/channel\/UCbU5gTFdNCPESA5aGipFW6g"]}]}},"_links":{"self":[{"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/pages\/3697"}],"collection":[{"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/comments?post=3697"}],"version-history":[{"count":7,"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/pages\/3697\/revisions"}],"predecessor-version":[{"id":33056,"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/pages\/3697\/revisions\/33056"}],"wp:attachment":[{"href":"https:\/\/www.filecloud.com\/blog\/wp-json\/wp\/v2\/media?parent=3697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}