summaryrefslogtreecommitdiff
path: root/www/posts/atom.xml
diff options
context:
space:
mode:
Diffstat (limited to 'www/posts/atom.xml')
-rw-r--r--www/posts/atom.xml26
1 files changed, 25 insertions, 1 deletions
diff --git a/www/posts/atom.xml b/www/posts/atom.xml
index db529ef..751a69c 100644
--- a/www/posts/atom.xml
+++ b/www/posts/atom.xml
@@ -4,8 +4,32 @@
<id>https://davidtsadler.com/posts/atom.xml</id>
<link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/index.html"/>
<link rel="self" type="application/atom+xml" href="https://davidtsadler.com/posts/atom.xml"/>
- <updated>2021-06-05T12:00:00Z</updated>
+ <updated>2021-06-13T12:00:00Z</updated>
<entry>
+ <title type="text">Backing Up a Git Repository</title>
+ <id>https://davidtsadler.com/posts/git/2021-06-13/backing-up-a-git-repository/index.html</id>
+ <link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/git/2021-06-13/backing-up-a-git-repository/index.html"/>
+ <author><name>David T. Sadler.</name></author>
+ <published>2021-06-13T12:00:00Z</published>
+ <updated>2021-06-13T12:00:00Z</updated>
+ <content type="html">&lt;h1&gt;Backing Up a Git Repository&lt;/h1&gt;&lt;blockquote&gt;Sun 13th June 2021 By David T. Sadler.&lt;/blockquote&gt;&lt;p&gt;Below is a quick and dirty way in which I backup all my repositories that are hosted at git.davidtsadler.com.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;shell&quot;&gt;#!/bin/sh
+
+DATE_PREFIX=$(date +%Y%m%d)
+
+BACKUP_DIRECTORY=/tmp
+
+BACKUP_FILE=&amp;quot;${BACKUP_DIRECTORY}/${DATE_PREFIX}-repositories.tar.gz&amp;quot;
+
+BACKUP_FILES=&amp;quot;${BACKUP_DIRECTORY}/*-repositories.tar.gz&amp;quot;
+
+REPOSITORIES=/home/git/*.git
+
+tar -czf $BACKUP_FILE $REPOSITORIES
+
+find $BACKUP_FILES -mtime +3 -delete
+
+exit 0&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;All it does it tar and gzip any .git directories found under /home/git. It also removes any backups that are more than three days old.&lt;/p&gt;&lt;p&gt;This script has been saved as /usr/bin/backup_repositories and is ran daily via cron.&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;cron&quot;&gt;0 3 * * * /usr/bin/backup_repositories &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It is important to know that this backup strategy is far from ideal for repositories that are heavily used as you run the high risk of trying to backup a repository as users are pushing to it. As git updates a repository in two phases this will lead to a backup that may not contain all the data and so won't be suitable for restoring. However its fine for my purposes since I'm the only user and it's unlikely that I will be making changes during the time the backup is running.&lt;/p&gt;&lt;h3&gt;Links&lt;/h3&gt;&lt;a href=&quot;/posts/git/2021-05-29/setting-up-a-self-host-git-server/&quot;&gt;2021-05-29 - Setting up a Self Hosted Git Server&lt;/a&gt;&lt;a href=&quot;/posts/git/&quot;&gt;Git - Read More Posts.&lt;/a&gt;&lt;p&gt;I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.&lt;/p&gt;&lt;a href=&quot;mailto:david@davidtsadler.com&quot;&gt;Email david@davidtsadler.com&lt;/a&gt;&lt;h3&gt;License&lt;/h3&gt;&lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.&lt;/a&gt;&lt;p&gt;Copyright © 2021 David T. Sadler.&lt;/p&gt;&lt;a href=&quot;/&quot;&gt;Return to Homepage.&lt;/a&gt;</content>
+</entry><entry>
<title type="text">Xrandr: Failed to Get Size of Gamma for Output Default</title>
<id>https://davidtsadler.com/posts/linux/2021-06-05/xrandr-failed-to-get-size-of-gamma-for-output-default/index.html</id>
<link rel="alternate" type="text/html" href="https://davidtsadler.com/posts/linux/2021-06-05/xrandr-failed-to-get-size-of-gamma-for-output-default/index.html"/>