{"id":3650,"date":"2022-12-16T09:28:54","date_gmt":"2022-12-16T09:28:54","guid":{"rendered":"https:\/\/gitprotect.io\/blog\/?p=3650"},"modified":"2024-07-10T11:52:48","modified_gmt":"2024-07-10T11:52:48","slug":"how-to-write-a-github-backup-script-and-why-not-to-do-it","status":"publish","type":"post","link":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/","title":{"rendered":"How To Write A GitHub Backup Script And Why (Not) To Do It?"},"content":{"rendered":"\n<p>The world is full of data. Everything we do, our plans and decisions are based on data, even if we are not aware of it. No doubt that IT systems also run on data, yet we &#8211; its creators &#8211; don\u2019t pay a lot of attention to it, or we do?&nbsp;<\/p>\n\n\n\n<p>Data is not just what we have on record regarding, for example, our products or users. Data is also the technology itself. Let\u2019s look at source code as an example. We won&#8217;t do anything with the data if our code stops working for some reason.&nbsp;<\/p>\n\n\n\n<p>And the risks are significant &#8211; starting from simple human error, infrastructure problems to <a href=\"https:\/\/gitprotect.io\/blog\/ransomware-attacks-on-github-bitbucket-and-gitlab-what-you-should-know\/\" target=\"_blank\" rel=\"noreferrer noopener\">ransomware attacks<\/a>. We cannot afford to lose data in any way. While database backup is a usual practice, <strong>can we say the same about source code backup<\/strong>?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The old ways\u2026<\/h2>\n\n\n\n<p>Both the problem and the attempts to solve this issue are not new. It&#8217;s not like I&#8217;m reinventing the wheel now. The source code is an asset. It is a product we are working on. And as such, we need to take care of it and secure it. The most natural, the easiest (apparently) and also the cheapest, again apparently, way is to build a script to do it for us.<br><\/p>\n\n\n\n<p>Well, after all, what is the problem? We make a backup script that periodically performs for us the &#8220;clone&#8221; operation of our entire repository. Alternatively, we have to figure out how to perform authorization, but that&#8217;s basically the only difficulty. A few lines of code and we&#8217;re done.<br><br>However, are we sure? What if we have several hundred repositories? Or new ones are created regularly? Let&#8217;s assume that we can handle that too, but what about the topic concerning metadata? After all, we don&#8217;t want to lose that either. That&#8217;s not why we use Pull Requests, Issues, etc. to allow ourselves to lose them. That&#8217;s what a simple &#8220;clone&#8221; won&#8217;t do for us.<\/p>\n\n\n\n<p>Back to the topic of authorization. I skipped over it earlier, but after all, it is a key issue because it is related to security. The wrong solution puts us at great risk of exposing our credentials. I hope I don&#8217;t need to tell you what that means.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to write a GitHub backup script<\/h2>\n\n\n\n<p>Now let&#8217;s move on to practice. <strong>Before we fire up such a backup script<\/strong> we must first analyze what should be in it. After all, the &#8220;clone&#8221; command and authorization data alone are definitely not enough. Below is a list of necessary elements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>address of the repository (or the entire organization)<\/li>\n\n\n\n<li>credentials &#8211; user and password or access token<\/li>\n\n\n\n<li>storage &#8211; the place where we will store our backups<\/li>\n\n\n\n<li>filename convention &#8211; mechanism for versioning<\/li>\n<\/ul>\n\n\n\n<p>This is the bare minimum for our solution to make sense. But you should also consider a few more elements, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>hostname &#8211; if we use our own hosting service&nbsp;<\/li>\n\n\n\n<li>reports &#8211; who and when performed a backup, and whether it was successful or not<\/li>\n\n\n\n<li>persistence &#8211; if we want to delete old data (e.g. older than 30 days)&nbsp;<\/li>\n\n\n\n<li>scheduling &#8211; when and how often we want to perform our backup&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>As it turns out, it is not as easy as it might seem at first. And yet still such a script is not flexible. If we want, for example, to make a backup after each code merge to the specific branch, what then? Such a file does not allow us to do much.<\/p>\n\n\n\n<p>Let me use a very popular script (323 stars and 144 forks &#8211; as of November 2022). It does what it is supposed to do and is, let&#8217;s call it, an acceptable solution. You can find GitHub backup script on <a href=\"https:\/\/gist.github.com\/rodw\/3073987#file-backup-github-sh\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GitHub Gist<\/a>.&nbsp; <\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p style=\"font-size:22px\">Eliminate data loss risk and ensure business continuity with <strong>the first TRUE Disaster Recovery software for GitHub<\/strong>.  <\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-background wp-element-button\" href=\"https:\/\/gitprotect.io\/sign-up.html\" style=\"border-radius:50px;background-color:#ff0300\" target=\"_blank\" rel=\"noreferrer noopener\">Start 14 days free GitProtect trial<\/a><\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>As you can see there we have some simple configurations to set up, then there are some validations, creating directories\/files, downloading a list of repositories (max 100) and so on. What is most relevant you can see in the image below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Cy7L58gs-BVzef3umF5RKvRjJzfBgXZicb1KrzLC2TJmhqTINkxtwSVoZOZa4y-ic_He2Mwdn2B7vN2uHOjdqo9LfsqMOwf5tmWwlOmEgjbLwBWrjBR6uoN5M8UMbNgE4I8tXEugnRH9N0V5cH3jT-0gqVX7yWMiKwfW1QYlmyiLYcX136T-CvHPPjluqjzL5zv0-NMB\" alt=\"GitHub Backup Script\" style=\"width:498px;height:169px\"\/><\/figure><\/div>\n\n\n<p>That is, for a given list of our repositories, we execute the &#8220;clone&#8221; command to get the repository itself, all wikis and issues. Not that bad. However, you can see that this is not the simplest solution. Nor is it flexible, as I mentioned earlier.<\/p>\n\n\n\n<p>I also recommend getting acquainted with <a href=\"https:\/\/github.com\/abusesa\/github-backup\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">a similar script written in Python<\/a>. It may not be as popular, but it has as many as 50 stars, so it is worth exploring this solution as well.&nbsp; &nbsp; <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GitHub backup tools<\/h2>\n\n\n\n<p>According to the formal definition, backup is a copy of computer data taken and stored elsewhere. In case of emergency it may be used to restore the original data. We can say a good backup should have such features as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>automation<\/li>\n\n\n\n<li>encryption<\/li>\n\n\n\n<li>versioning<\/li>\n\n\n\n<li>data retention<\/li>\n\n\n\n<li>recovery process<\/li>\n\n\n\n<li>scalability<\/li>\n<\/ul>\n\n\n\n<p>So, does the backup script for GitHub created in this way meet this definition? Unfortunately, not really. Here we have a problem with scalability, encryption, and we haven&#8217;t even touched on recovery yet. And after all, this is a key issue! Why do we have a backup if we don&#8217;t know how to restore it quickly?<\/p>\n\n\n\n<p>It is also worth noting that, admittedly, we rarely actually lose data. Our risk and cost is the time it takes to recover that data or restore the system to operation. Nowadays, downtime is unacceptable, so lightning-fast response and the ability to quickly restore a backup are extremely important to us. It would be difficult to achieve all these features with a rather simple, manually created backup scripts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why you should pick a backup tool instead of the script<\/h2>\n\n\n\n<p>To solve these problems, we can go further in writing more scripts and extending existing ones. But we can also use already existing third-party tools. This comes at a price, but allows us to overcome many obstacles.&nbsp;<\/p>\n\n\n\n<p>Creating your own <a href=\"https:\/\/gitprotect.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Git backup<\/a> scripts may seem cheaper, faster and better, especially in the early stages of a project or organization. And certainly the biggest advantage of this approach is customization. It&#8217;s our program, so we can do what we want and how we want. We have full control over it. But in my opinion, that&#8217;s where the advantages of this solution ends.<\/p>\n\n\n\n<p>The large (and constantly increasing) maintenance costs in the future, or the time required to manage and administer such scripts, are some of the main downsides of this approach. It is also worth noting that we have no guarantee of the reliability of the backup. I described one of such use cases in this article, the title of which already shows my opinion about writing <a href=\"https:\/\/devops.com\/why-do-you-need-github-backup\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">backup scripts for GitHub<\/a>.&nbsp; &nbsp;<\/p>\n\n\n\n<p>I&#8217;ve already mentioned how critical Disaster Recovery is, and yet for that we would need another script. And probably more, to do the backup of the script&#8230;. making backups. It sounds absurd. After all, that&#8217;s not what we should be spending our money and our specialists&#8217; (or ourselves) time on.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"atbs-responsive-video\"><iframe loading=\"lazy\" title=\"DevOps backup script vs. third-party tool\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/z1JfJ1wfb2k?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Benefits of GitProtect<\/h2>\n\n\n\n<p>With help comes a third-party tool called GitProtect. Okay, I&#8217;m sure some of us will cringe, because it&#8217;s another tool over which we don&#8217;t have full control and for which we have to pay. Apparently so, but after all, we have to pay for the time spent writing our own scripts too!<\/p>\n\n\n\n<p>Among the advantages of this tool, we have, for example, central management, virtually unlimited configuration options or the ability to assign permissions and roles in the team. The latter allows us to conveniently manage who has access to what, so we can separate responsibility and management of the backup topic, for example, by teams or departments of our organization.<\/p>\n\n\n\n<p>In terms of convenience and transparency, we have email (or Slack) notifications available here, as well as daily reports with compliance or audit information. And, of course, last but not least &#8211; <a href=\"https:\/\/gitprotect.io\/use-cases\/disaster-recovery.html\" target=\"_blank\" rel=\"noreferrer noopener\">Disaster Recovery<\/a> from the real deal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Let&#8217;s summarize what I have described above by just changing the title of this article. We should not be asking: &#8220;How to write a <a href=\"https:\/\/gitprotect.io\/github.html\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub backup<\/a> script and why (not) to do it?&#8221;, but rather &#8220;Why should you never ever use a GitHub backup script?&#8221;.<\/p>\n\n\n\n<p>Let&#8217;s respect our time and allow ourselves to focus on developing our own business. Let&#8217;s not spend it on necessary, although boring, administrative topics, when someone can do it for us. And do it better!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The world is full of data. Everything we do, our plans and decisions are based on data, even if we are not aware of it. No doubt that IT systems also run on data, yet we &#8211; its creators &#8211; don\u2019t pay a lot of attention to it, or we do?&nbsp; Data is not just what we have on record regarding, for example, our products or users. Data is also the technology itself. Let\u2019s look at source code as an example. We won&#8217;t do anything with the data if our code stops working for some reason.&nbsp; And the risks are [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":3655,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-3650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-github","post--single"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Write A GitHub Backup Script And Why (Not) To Do It? - Blog | GitProtect.io<\/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:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Write A GitHub Backup Script And Why (Not) To Do It? - Blog | GitProtect.io\" \/>\n<meta property=\"og:description\" content=\"The world is full of data. Everything we do, our plans and decisions are based on data, even if we are not aware of it. No doubt that IT systems also run on data, yet we &#8211; its creators &#8211; don\u2019t pay a lot of attention to it, or we do?&nbsp; Data is not just what we have on record regarding, for example, our products or users. Data is also the technology itself. Let\u2019s look at source code as an example. We won&#8217;t do anything with the data if our code stops working for some reason.&nbsp; And the risks are [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | GitProtect.io\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/XoperoSoftware\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-16T09:28:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-10T11:52:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tomasz Lisowski\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:site\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Lisowski\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\"},\"author\":{\"name\":\"Tomasz Lisowski\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/9437be55e0e82150a20247f63e2fef79\"},\"headline\":\"How To Write A GitHub Backup Script And Why (Not) To Do It?\",\"datePublished\":\"2022-12-16T09:28:54+00:00\",\"dateModified\":\"2024-07-10T11:52:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\"},\"wordCount\":1435,\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg\",\"articleSection\":[\"GitHub\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\",\"name\":\"How To Write A GitHub Backup Script And Why (Not) To Do It? - Blog | GitProtect.io\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg\",\"datePublished\":\"2022-12-16T09:28:54+00:00\",\"dateModified\":\"2024-07-10T11:52:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg\",\"width\":1000,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/gitprotect.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Write A GitHub Backup Script And Why (Not) To Do It?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"name\":\"GitProtect.io Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gitprotect.io\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\",\"name\":\"GitProtect.io\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"width\":528,\"height\":528,\"caption\":\"GitProtect.io\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/XoperoSoftware\/\",\"https:\/\/x.com\/GitProtectio\",\"https:\/\/www.linkedin.com\/company\/xopero-software\/\",\"https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/9437be55e0e82150a20247f63e2fef79\",\"name\":\"Tomasz Lisowski\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/tomasz-lisowski_avatar-96x96.jpg\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/tomasz-lisowski_avatar-96x96.jpg\",\"caption\":\"Tomasz Lisowski\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/tomasz-lisowski-01366a75\/\"],\"url\":\"https:\/\/gitprotect.io\/blog\/author\/tomasz-lisowski\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Write A GitHub Backup Script And Why (Not) To Do It? - Blog | GitProtect.io","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:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/","og_locale":"en_US","og_type":"article","og_title":"How To Write A GitHub Backup Script And Why (Not) To Do It? - Blog | GitProtect.io","og_description":"The world is full of data. Everything we do, our plans and decisions are based on data, even if we are not aware of it. No doubt that IT systems also run on data, yet we &#8211; its creators &#8211; don\u2019t pay a lot of attention to it, or we do?&nbsp; Data is not just what we have on record regarding, for example, our products or users. Data is also the technology itself. Let\u2019s look at source code as an example. We won&#8217;t do anything with the data if our code stops working for some reason.&nbsp; And the risks are [&hellip;]","og_url":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/","og_site_name":"Blog | GitProtect.io","article_publisher":"https:\/\/www.facebook.com\/XoperoSoftware\/","article_published_time":"2022-12-16T09:28:54+00:00","article_modified_time":"2024-07-10T11:52:48+00:00","og_image":[{"width":1000,"height":600,"url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg","type":"image\/jpeg"}],"author":"Tomasz Lisowski","twitter_card":"summary_large_image","twitter_creator":"@GitProtectio","twitter_site":"@GitProtectio","twitter_misc":{"Written by":"Tomasz Lisowski","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#article","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/"},"author":{"name":"Tomasz Lisowski","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/9437be55e0e82150a20247f63e2fef79"},"headline":"How To Write A GitHub Backup Script And Why (Not) To Do It?","datePublished":"2022-12-16T09:28:54+00:00","dateModified":"2024-07-10T11:52:48+00:00","mainEntityOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/"},"wordCount":1435,"publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg","articleSection":["GitHub"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/","url":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/","name":"How To Write A GitHub Backup Script And Why (Not) To Do It? - Blog | GitProtect.io","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg","datePublished":"2022-12-16T09:28:54+00:00","dateModified":"2024-07-10T11:52:48+00:00","breadcrumb":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#primaryimage","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2022\/12\/GitHub-backup-script.jpg","width":1000,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/gitprotect.io\/blog\/how-to-write-a-github-backup-script-and-why-not-to-do-it\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/gitprotect.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Write A GitHub Backup Script And Why (Not) To Do It?"}]},{"@type":"WebSite","@id":"https:\/\/gitprotect.io\/blog\/#website","url":"https:\/\/gitprotect.io\/blog\/","name":"GitProtect.io Blog","description":"","publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gitprotect.io\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gitprotect.io\/blog\/#organization","name":"GitProtect.io","url":"https:\/\/gitprotect.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","width":528,"height":528,"caption":"GitProtect.io"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/XoperoSoftware\/","https:\/\/x.com\/GitProtectio","https:\/\/www.linkedin.com\/company\/xopero-software\/","https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w"]},{"@type":"Person","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/9437be55e0e82150a20247f63e2fef79","name":"Tomasz Lisowski","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/tomasz-lisowski_avatar-96x96.jpg","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/tomasz-lisowski_avatar-96x96.jpg","caption":"Tomasz Lisowski"},"sameAs":["https:\/\/www.linkedin.com\/in\/tomasz-lisowski-01366a75\/"],"url":"https:\/\/gitprotect.io\/blog\/author\/tomasz-lisowski\/"}]}},"_links":{"self":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/3650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/comments?post=3650"}],"version-history":[{"count":6,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/3650\/revisions"}],"predecessor-version":[{"id":5411,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/3650\/revisions\/5411"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media\/3655"}],"wp:attachment":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media?parent=3650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/categories?post=3650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/tags?post=3650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}