<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/serendipity/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://blog.adslweb.net/serendipity/feeds/atom.xml" rel="self" title="Just my Blog" type="application/atom+xml" />
    <link href="http://blog.adslweb.net/serendipity/"                        rel="alternate"    title="Just my Blog" type="text/html" />
    <link href="http://blog.adslweb.net/serendipity/rss.php?version=2.0"     rel="alternate"    title="Just my Blog" type="application/rss+xml" />
    <title type="html">Just my Blog</title>
    <subtitle type="html">SELECT * FROM users WHERE clue &gt; 0</subtitle>
    <icon>http://blog.adslweb.net/serendipity/templates/competition/img/s9y_banner_small.png</icon>
    <id>http://blog.adslweb.net/serendipity/</id>
    <updated>2010-08-05T05:12:38Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.1">Serendipity 1.5.1 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>

    <entry>
        <link href="http://blog.adslweb.net/serendipity/article/280/use-subversion-to-publish-websites" rel="alternate" title="use subversion to publish websites" />
        <author>
            <name>Pieter de Rijk</name>
                    </author>
    
        <published>2010-08-04T17:54:30Z</published>
        <updated>2010-08-05T05:12:38Z</updated>
        <wfw:comment>http://blog.adslweb.net/serendipity/wfwcomment.php?cid=280</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.adslweb.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=280</wfw:commentRss>
    
    
        <id>http://blog.adslweb.net/serendipity/article/280/guid</id>
        <title type="html">use subversion to publish websites</title>
        <content type="xhtml" xml:base="http://blog.adslweb.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Sometimes I'm really surprised about myself... especially how lazy I am. <img src="http://blog.adslweb.net/serendipity/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /></p> <br />
<p>I'm currently playing around with one of my private websites, and to improve developing I decided to use subversion. So far so good, but I wanted that the committed subversion code was automatically online on the webserver. So I did the following very simple trick.</p> <br />
<p> First I check out the code (subtree) from the subversion server (which is using https):</p> <br />
<p><font face="courier new,courier,monospace">$ cd /sites<br />$ mv dev.adslweb.net{,-backup}<br />$ svn co https://svn.adslweb.net/svn/websites/dev.adslweb.net</font></p> <br />
<p>Next step was to commit the current content of the website into subversion:</p> <br />
<p><font face="courier new,courier,monospace">$ cd /sites/dev.adslweb.net<br />$ cp -Rv /sites/dev.adslweb.net-backup/*&#160; ./<br />$ svn add&#160;*<br />$ svn commit -m &quot;Initial commit of ADSLWEB.net dev env&quot;</font></p> <br />
<p>Now download the simple script I created for making sure that subversion doesn't fire off twice for updating the same tree.</p> <br />
<p> <a href="www.xs4all.nl/%7Epaderijk/pics/svn-update.sh" target="_blank">Download svn-update.sh via this link</a>.<br /></p> <br />
<p>So something like this:<br /></p> <br />
<p><font face="courier new,courier,monospace">$ mkdir ~/scripts/<br />$ cd ~/scripts<br />$ wget http://www.xs4all.nl/~paderijk/pics/svn-update.sh<br />$ chmod 700 svn-update.sh</font><br /></p> <br />
<p>Now... the last step... create a crontab entry with the following content:</p> <br />
<p><font face="courier new,courier,monospace">*/1&#160;*&#160;*&#160;*&#160;* /home/pieter/scripts/svn-update.sh /sites/dev.adslweb.net 2&gt;&amp;1 &gt; /dev/null</font></p> <br />
<p>&#160;And guess... and it works like a charm, on every new commit done by whoever... you get your online site updated within 1 minute without the need log in into the website/webserver using ftp/ssh/whatever.<br /></p> <br />
<p><br /></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://blog.adslweb.net/serendipity/article/279/More-flexible-yum-repo-sync-script" rel="alternate" title="More flexible yum-repo sync script" />
        <author>
            <name>Pieter de Rijk</name>
                    </author>
    
        <published>2010-06-01T06:30:40Z</published>
        <updated>2010-06-01T06:30:40Z</updated>
        <wfw:comment>http://blog.adslweb.net/serendipity/wfwcomment.php?cid=279</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.adslweb.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=279</wfw:commentRss>
    
    
        <id>http://blog.adslweb.net/serendipity/article/279/guid</id>
        <title type="html">More flexible yum-repo sync script</title>
        <content type="xhtml" xml:base="http://blog.adslweb.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>In the past I started syncing every night the Updates-repositories from Fedora and CentOS on a local server, just to speed up updates/kick starts et cetera... The first version of the script was very quick and dirty, now I've a more decent script that allow you to add/remove very quick new versions of CentOS and Fedora.</p><br />
<p>&#160;You can find the script <a href="http://bit.ly/90rRpP" target="_blank">here</a>.<br /></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://blog.adslweb.net/serendipity/article/278/How-full-are-your-snapshot-volumes-in-LVM" rel="alternate" title="How full are your snapshot volumes in LVM?" />
        <author>
            <name>Pieter de Rijk</name>
                    </author>
    
        <published>2010-04-22T06:29:38Z</published>
        <updated>2010-04-22T06:35:36Z</updated>
        <wfw:comment>http://blog.adslweb.net/serendipity/wfwcomment.php?cid=278</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.adslweb.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=278</wfw:commentRss>
    
    
        <id>http://blog.adslweb.net/serendipity/article/278/guid</id>
        <title type="html">How full are your snapshot volumes in LVM?</title>
        <content type="xhtml" xml:base="http://blog.adslweb.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>As I mentioned in my previous post, which is already 2 months old :(, I'm using snapshots for data retention.</p> <br />
<p>Now I run up in the situation, that I wanted to know how <strong>full</strong> the snapshots are. A 'normal' <font face="courier new,courier,monospace">df</font> will not work... but I figured it out! The command <font face="courier new,courier,monospace">lvs</font> is willing to do the work:</p> <br />
<p><font face="courier new,courier,monospace"># lvs --aligned --separator \| vol_backup<br />&#160; LV&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |VG&#160;&#160;&#160;&#160;&#160;&#160;&#160; |Attr&#160; |LSize |Origin|Snap% |Move|Log|Copy% |Convert<br />&#160; lvm0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |vol_backup|owi-ao|40.00G|&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100412_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 23.71|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100413_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 21.70|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100414_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 19.52|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100415_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 17.53|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100416_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 15.54|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100417_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 13.56|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100418_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; | 11.56|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100419_2353|vol_backup|swi-a-| 4.00G|lvm0&#160; |&#160; 9.02|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100420_2353|vol_backup|swi-a-| 4.00G|lvm0&#160; |&#160; 6.76|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160; snap-20100421_2350|vol_backup|swi-a-| 4.00G|lvm0&#160; |&#160; 2.79|&#160;&#160;&#160; |&#160;&#160; |&#160;&#160;&#160;&#160;&#160; |&#160; </font></p><br />
<p> </p><br />
<p>In the '<strong><font face="courier new,courier,monospace">Snap%</font></strong>' column you can see how full your snapshot volume is!<br /></p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://blog.adslweb.net/serendipity/article/277/Creating-Snapshots-of-a-backup-using-LVM-snapshot" rel="alternate" title="Creating Snapshots of a backup using LVM snapshot" />
        <author>
            <name>Pieter de Rijk</name>
                    </author>
    
        <published>2010-02-22T08:18:43Z</published>
        <updated>2010-02-22T13:36:49Z</updated>
        <wfw:comment>http://blog.adslweb.net/serendipity/wfwcomment.php?cid=277</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://blog.adslweb.net/serendipity/rss.php?version=atom1.0&amp;type=comments&amp;cid=277</wfw:commentRss>
    
            <category scheme="http://blog.adslweb.net/serendipity/categories/10-Herakles" label="Herakles" term="Herakles" />
            <category scheme="http://blog.adslweb.net/serendipity/categories/1-LinuxUnixBSD" label="Linux/Unix/BSD" term="Linux/Unix/BSD" />
            <category scheme="http://blog.adslweb.net/serendipity/categories/11-Security" label="Security" term="Security" />
            <category scheme="http://blog.adslweb.net/serendipity/categories/3-Work" label="Work" term="Work" />
    
        <id>http://blog.adslweb.net/serendipity/article/277/guid</id>
        <title type="html">Creating Snapshots of a backup using LVM snapshot</title>
        <content type="xhtml" xml:base="http://blog.adslweb.net/serendipity/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Normally I used to have a backup-retention-script in place that will create a TAR-ball of the backup data (using <a target="_blank" href="http://adslweb.net/tools/herakles">Herakles</a>). But this way I was not able to have a retention of longer then 3 days <img src="http://blog.adslweb.net/serendipity/templates/default/img/emoticons/sad.png" alt=":-(" style="display: inline; vertical-align: bottom;" class="emoticon" /> </p> <br />
<p>So I had to look into another solution, I could add a new harddrive in the server... but there should be something else possible. So I ended up by using LVM snapshots. So I created a Volume group of about 100GB. In that volume group I created a logical volume of about 30GB, which is enough (and if not, we can 'grow' the Filesystem thanks to LVM <img src="http://blog.adslweb.net/serendipity/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /> )</p> <br />
<p>After having all that done, I've created a script located in /root/scripts/lvm-snapshot. This script runs every midnight and creates a snapshot.</p> <br />
<p><font size="1" face="courier new,courier,monospace">#!/bin/bash<br />#<br /># Create LVM Snapshots<br />#<br />#<br />#---------------------------------------------------------------------------------------------------------------<br />CURRENT_SNAPNAME=&quot;snap-&quot;$(date &quot;+%Y%m%d%H%M%S&quot;)<br />VOLUME2SNAPSHOT=&quot;/dev/vol_backup/lvm0&quot;<br />LVMSNAPSHOTCMD=&quot;/usr/sbin/lvcreate -L 2G -s -n $CURRENT_SNAPNAME $VOLUME2SNAPSHOT&quot;<br />LINE=&quot;---------------------------------------------------------------------------------------------------------------------&quot;<br /><br />echo $LINE<br />df -h /mnt/data<br />echo $LINE<br />$LVMSNAPSHOTCMD 2&gt; /dev/null<br />#---------------------------------------------------------------------------------------------------------------<br />SNAPSHOT_RETENTION=15<br />CURRENT_SNAPSHOT_COUNT=$(lvdisplay | grep &quot;^&#160; LV Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /dev/vol_backup/snap&quot; | sort | awk '{ print $3 }' | wc -l)<br /><br />OVERFLOW=$(echo $CURRENT_SNAPSHOT_COUNT - $SNAPSHOT_RETENTION | bc)<br />if [ $OVERFLOW -gt 0 ];<br />then<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo $LINE<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; for files in&#160; $(lvdisplay | grep &quot;^&#160; LV Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /dev/vol_backup/snap&quot; | sort | awk '{ print $3 }' | head -n$OVERFLOW);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; do<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /usr/sbin/lvremove -f $files 2&gt; /dev/null<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; done<br />fi<br />#---------------------------------------------------------------------------------------------------------------<br />echo $LINE<br />/usr/sbin/vgdisplay vol_backup<br />echo $LINE<br />/usr/sbin/lvdisplay $VOLUME2SNAPSHOT</font><br /></p> <br />
<p>And the crontab entry is:</p> <br />
<p><font size="1" face="courier new,courier,monospace"># crontab -l<br />0 0 <strong> </strong> * /root/scripts/lvm-snapshot</font> <br /></p> <br />
<p><br /></p> 
            </div>
        </content>
        
    </entry>

</feed>