{"id":1406,"date":"2011-07-24T22:12:49","date_gmt":"2011-07-24T22:12:49","guid":{"rendered":"https:\/\/supportex.net\/?p=1406"},"modified":"2019-05-10T21:03:15","modified_gmt":"2019-05-10T19:03:15","slug":"exceptions-copying-directory-rsync","status":"publish","type":"post","link":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/","title":{"rendered":"How to exclude directories while using rsync"},"content":{"rendered":"<p>Sometimes when you copy a lot of data with rsync you may to exclude some sub-directories.<br \/>\nYou can do this by using &#8211;exclude.<br \/>\nFor instance, you want to copy files from \/mnt to \/home\/destination_dir\/, and you want to exclude directory \/mnt\/dir1\/dir2\/.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">rsync -az  --exclude='dir1\/dir2\/' \/mnt\/ \/home\/destination_dir\/<br \/>\n<\/code><\/p>\n<p>A lot of users do mistake when specifing path. This path should be relative to source directory (\/mnt in our case).<\/p>\n<p><strong>Didn&#8217;t find the answer to your question? <a href=\"\/contacts\/\">Ask it<\/a> our administrators to reply we will publish on website.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes when you copy a lot of data with rsync you may to exclude some sub-directories. You can do this by using &#8211;exclude. For instance, you want to copy files from \/mnt to \/home\/destination_dir\/, and you want to exclude directory \/mnt\/dir1\/dir2\/. rsync -az &#8211;exclude=&#8217;dir1\/dir2\/&#8217; \/mnt\/ \/home\/destination_dir\/ A lot of users do mistake when specifing path.&hellip; <\/p>\n<div class=\"readmore-wrapper\"><a href=\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\" class=\"more-link\">Read <\/a><\/div>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[218,219,220],"class_list":["post-1406","post","type-post","status-publish","format-standard","hentry","category-linux","tag-exclude-en","tag-rsync-en","tag-tips-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to exclude directories while using rsync &#8211; Supportex.NET blog<\/title>\n<meta name=\"description\" content=\"How to exclude directories while using rsync\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to exclude directories while using rsync &#8211; Supportex.NET blog\" \/>\n<meta property=\"og:description\" content=\"How to exclude directories while using rsync\" \/>\n<meta property=\"og:url\" content=\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\" \/>\n<meta property=\"og:site_name\" content=\"Supportex.NET blog\" \/>\n<meta property=\"article:published_time\" content=\"2011-07-24T22:12:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-10T19:03:15+00:00\" \/>\n<meta name=\"author\" content=\"bob\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"bob\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\"},\"author\":{\"name\":\"bob\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/2425bc5aba0a9c1db43884a9f19f676d\"},\"headline\":\"How to exclude directories while using rsync\",\"datePublished\":\"2011-07-24T22:12:49+00:00\",\"dateModified\":\"2019-05-10T19:03:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\"},\"wordCount\":92,\"commentCount\":0,\"keywords\":[\"exclude\",\"rsync\",\"tips\"],\"articleSection\":[\"linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\",\"url\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\",\"name\":\"How to exclude directories while using rsync &#8211; Supportex.NET blog\",\"isPartOf\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\"},\"datePublished\":\"2011-07-24T22:12:49+00:00\",\"dateModified\":\"2019-05-10T19:03:15+00:00\",\"author\":{\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/2425bc5aba0a9c1db43884a9f19f676d\"},\"description\":\"How to exclude directories while using rsync\",\"breadcrumb\":{\"@id\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/supportex.net\/blog\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to exclude directories while using rsync\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#website\",\"url\":\"https:\/\/supportex.net\/blog\/en\/\",\"name\":\"Supportex.NET blog\",\"description\":\"Server and network management company\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/2425bc5aba0a9c1db43884a9f19f676d\",\"name\":\"bob\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/affe5289af0481ab0f1461e54d1bb31b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/affe5289af0481ab0f1461e54d1bb31b?s=96&d=mm&r=g\",\"caption\":\"bob\"},\"url\":\"https:\/\/supportex.net\/blog\/author\/bob\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to exclude directories while using rsync &#8211; Supportex.NET blog","description":"How to exclude directories while using rsync","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:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/","og_locale":"en_US","og_type":"article","og_title":"How to exclude directories while using rsync &#8211; Supportex.NET blog","og_description":"How to exclude directories while using rsync","og_url":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/","og_site_name":"Supportex.NET blog","article_published_time":"2011-07-24T22:12:49+00:00","article_modified_time":"2019-05-10T19:03:15+00:00","author":"bob","twitter_misc":{"Written by":"bob"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#article","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/"},"author":{"name":"bob","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/2425bc5aba0a9c1db43884a9f19f676d"},"headline":"How to exclude directories while using rsync","datePublished":"2011-07-24T22:12:49+00:00","dateModified":"2019-05-10T19:03:15+00:00","mainEntityOfPage":{"@id":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/"},"wordCount":92,"commentCount":0,"keywords":["exclude","rsync","tips"],"articleSection":["linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/","url":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/","name":"How to exclude directories while using rsync &#8211; Supportex.NET blog","isPartOf":{"@id":"https:\/\/supportex.net\/blog\/en\/#website"},"datePublished":"2011-07-24T22:12:49+00:00","dateModified":"2019-05-10T19:03:15+00:00","author":{"@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/2425bc5aba0a9c1db43884a9f19f676d"},"description":"How to exclude directories while using rsync","breadcrumb":{"@id":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/supportex.net\/blog\/2011\/07\/exceptions-copying-directory-rsync\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/supportex.net\/blog\/en\/"},{"@type":"ListItem","position":2,"name":"How to exclude directories while using rsync"}]},{"@type":"WebSite","@id":"https:\/\/supportex.net\/blog\/en\/#website","url":"https:\/\/supportex.net\/blog\/en\/","name":"Supportex.NET blog","description":"Server and network management company","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/supportex.net\/blog\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/2425bc5aba0a9c1db43884a9f19f676d","name":"bob","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/supportex.net\/blog\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/affe5289af0481ab0f1461e54d1bb31b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/affe5289af0481ab0f1461e54d1bb31b?s=96&d=mm&r=g","caption":"bob"},"url":"https:\/\/supportex.net\/blog\/author\/bob\/"}]}},"_links":{"self":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/1406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/comments?post=1406"}],"version-history":[{"count":2,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/1406\/revisions"}],"predecessor-version":[{"id":3235,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/posts\/1406\/revisions\/3235"}],"wp:attachment":[{"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/media?parent=1406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/categories?post=1406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/supportex.net\/blog\/wp-json\/wp\/v2\/tags?post=1406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}