{"id":93,"date":"2018-10-30T09:23:27","date_gmt":"2018-10-30T09:23:27","guid":{"rendered":"https:\/\/www.onlinenote.in\/linux\/?p=93"},"modified":"2019-03-19T11:05:30","modified_gmt":"2019-03-19T05:35:30","slug":"create-zip-archive-excluding-specific-files-directories","status":"publish","type":"post","link":"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/","title":{"rendered":"Create zip archive excluding specific Files &#038; Directories"},"content":{"rendered":"<ul>\n<li>Create archive of all files under public_html directory ignoring all files and folders including text backup in there named\n<pre># zip -r public_html.zip public_html -x *backup*\r\n<\/pre>\n<\/li>\n<li>Create archive of all files under httpdocs directory ignoring .svn or .git files and directories.\n<pre># zip -r httpdocs.zip httpdocs --exclude *.svn* --exclude *.git*\r\n<\/pre>\n<\/li>\n<li>Create archive of all files under httpdocs directory ignoring all files and directories ending with with .log.\n<pre># zip -r httpdocs.zip httpdocs --exclude \"*.log\"\r\n<\/pre>\n<\/li>\n<li>Exclude .git file and node_modules directory\n<pre class=\"\">$ zip -r [target_file] [source_file] -x *.git* node_modules\/\\*\r\n<\/pre>\n<\/li>\n<li>Exclude .git file and files in node_modules directory, but keep node_modules directory\n<pre class=\"\">$ zip -r [target_file] [source_file] -x *.git* node_modules\/**\\*<\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>Exclude cache, backups, uploads directory, but keep node_modules directory (Current date for the generated file)\n<pre class=\"\">$ sudo zip -r \/var\/www\/backup\/backup$(date +\"%Y-%m-%d\").zip  \/var\/www\/html -x \"*cache*\" -x \"*backups*\" -x \"*uploads*\"<\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create archive of all files under public_html directory ignoring all files and folders including text backup in there named # zip -r public_html.zip public_html -x *backup* Create archive of all files under httpdocs directory ignoring .svn or .git files and directories. # zip -r httpdocs.zip httpdocs &#8211;exclude *.svn* &#8211;exclude *.git* Create archive of all files [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create zip archive excluding specific Files &amp; Directories - linux<\/title>\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.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create zip archive excluding specific Files &amp; Directories - linux\" \/>\n<meta property=\"og:description\" content=\"Create archive of all files under public_html directory ignoring all files and folders including text backup in there named # zip -r public_html.zip public_html -x *backup* Create archive of all files under httpdocs directory ignoring .svn or .git files and directories. # zip -r httpdocs.zip httpdocs --exclude *.svn* --exclude *.git* Create archive of all files [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/\" \/>\n<meta property=\"og:site_name\" content=\"linux\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-30T09:23:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-19T05:35:30+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/\",\"url\":\"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/\",\"name\":\"Create zip archive excluding specific Files & Directories - linux\",\"isPartOf\":{\"@id\":\"https:\/\/www.onlinenote.in\/linux\/#website\"},\"datePublished\":\"2018-10-30T09:23:27+00:00\",\"dateModified\":\"2019-03-19T05:35:30+00:00\",\"author\":{\"@id\":\"\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.onlinenote.in\/linux\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create zip archive excluding specific Files &#038; Directories\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.onlinenote.in\/linux\/#website\",\"url\":\"https:\/\/www.onlinenote.in\/linux\/\",\"name\":\"linux\",\"description\":\"Code Snippets\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.onlinenote.in\/linux\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create zip archive excluding specific Files & Directories - linux","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.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/","og_locale":"en_US","og_type":"article","og_title":"Create zip archive excluding specific Files & Directories - linux","og_description":"Create archive of all files under public_html directory ignoring all files and folders including text backup in there named # zip -r public_html.zip public_html -x *backup* Create archive of all files under httpdocs directory ignoring .svn or .git files and directories. # zip -r httpdocs.zip httpdocs --exclude *.svn* --exclude *.git* Create archive of all files [&hellip;]","og_url":"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/","og_site_name":"linux","article_published_time":"2018-10-30T09:23:27+00:00","article_modified_time":"2019-03-19T05:35:30+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/","url":"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/","name":"Create zip archive excluding specific Files & Directories - linux","isPartOf":{"@id":"https:\/\/www.onlinenote.in\/linux\/#website"},"datePublished":"2018-10-30T09:23:27+00:00","dateModified":"2019-03-19T05:35:30+00:00","author":{"@id":""},"breadcrumb":{"@id":"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.onlinenote.in\/linux\/create-zip-archive-excluding-specific-files-directories\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.onlinenote.in\/linux\/"},{"@type":"ListItem","position":2,"name":"Create zip archive excluding specific Files &#038; Directories"}]},{"@type":"WebSite","@id":"https:\/\/www.onlinenote.in\/linux\/#website","url":"https:\/\/www.onlinenote.in\/linux\/","name":"linux","description":"Code Snippets","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.onlinenote.in\/linux\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":""}]}},"_links":{"self":[{"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/posts\/93"}],"collection":[{"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":2,"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/posts\/93\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onlinenote.in\/linux\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}