<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Michael Wassmer</title>
	<atom:link href="http://www.michaelwassmer.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelwassmer.net</link>
	<description>Freelance webdesign and development</description>
	<lastBuildDate>Wed, 03 Feb 2010 07:38:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Estée Lauder</title>
		<link>http://www.michaelwassmer.net/cd-rom/estee-lauder/</link>
		<comments>http://www.michaelwassmer.net/cd-rom/estee-lauder/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 07:24:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CD-Rom]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/?p=532</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/cd-rom/estee-lauder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Première Urgence</title>
		<link>http://www.michaelwassmer.net/websites/premiere-urgence/</link>
		<comments>http://www.michaelwassmer.net/websites/premiere-urgence/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 07:13:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/?p=528</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/websites/premiere-urgence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An automated backup script for your websites</title>
		<link>http://www.michaelwassmer.net/blog/an-automated-backup-script-for-your-websites/</link>
		<comments>http://www.michaelwassmer.net/blog/an-automated-backup-script-for-your-websites/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 11:27:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/?p=461</guid>
		<description><![CDATA[If you are a web developper you probably have a local and/or remote server which hosts several websites, testsites, various apps, etc.. Of course, once in a while you want to make backups of these. If you do it the classic and simple way perhaps you download the websites folder via FTP and make a [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a web developper you probably have a local and/or remote server which hosts several websites, testsites, various apps, etc.. Of course, once in a while you want to make backups of these. If you do it the classic and simple way perhaps you download the websites folder via <em>FTP</em> and make a dump of your database in <em>phpMyAdmin</em>, zip both and store them on a backup drive. But after a while, when you have dozens of sites on your server, you can end up spending a lot of time doing that. That&#8217;s exactly what happened to me, and that&#8217;s when I started to look for an automated way to do my backups.</p>
<p><span id="more-461"></span>I&#8217;m not a shell script expert, but here&#8217;s what I could put together quite easily after looking around a little on the net. This is a script that will <strong>automate the backup process</strong>. What it does is display a multiple choices menu with your websites folders. Once you select one, it gzips the folder, makes a bzipped backup of the corresponding database, and moves those two archives to a backup folder at the root level of your server.</p>
<h3>The code</h3>
<pre class="brush: bash; wrap-lines: false;">
#!/bin/bash

# Define Backup folder
BACKUP_DIR = /home/user/backups

# backupDB() : Make a dump of the database and bzip it.
backupDB (){
    echo -e &quot;nStarting database backup of ${SITE}&quot;
    mysqldump --user=${DB_USER} --password=${DB_PASS} --host=${DB_HOST} ${DB_NAME}
    | bzip2 -c &gt; ${BACKUP_DIR}/${SITE}_sql_$(date +%m%d%y).sql.bz2
    if [ &quot;$?&quot; -ne &quot;0&quot; ]; then
	    echo -e &quot;nError while doing database backup of ${SITE} !&quot;
	    exit 1
    fi
    echo -e &quot;-&gt; Backup of ${SITE} database successful !&quot;
}

# backupFiles() : gzip the files, add the date and move them to a backup folder
backupFiles (){
    echo -e &quot;nStarting files backup of ${SITE}&quot;
    tar czf ${BACKUP_DIR}/${SITE}_www_$(date +%m%d%y).tar.gz ${SITE_DIR}
    if [ &quot;$?&quot; -ne &quot;0&quot; ]; then
	    echo -e &quot;nError while doing files backup of ${SITE} !&quot;
    	exit 1
    fi
    echo -e &quot;-&gt; Backup of ${SITE} files successful !&quot;
    echo -e &quot;nWould you like to backup another website ?&quot;
    select RESTART in &quot;yes&quot; &quot;no&quot; ; do
        if [ -z &quot;${RESTART}&quot; ]; then
            echo -e &quot;Please enter a number.&quot;
        else
            # yes
            if [ &quot;${RESTART}&quot; = &quot;yes&quot; ]; then
                    backupInit
            fi
            # no
            if [ &quot;${RESTART}&quot; = &quot;no&quot; ]; then
                    reset
                    exit
            fi
            break
        fi
        echo
    done
}

# backupTnit() : main function, display the menu and lauch backups
backupInit (){
    reset
    printf &quot;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤n&quot;
    printf &quot;¤       Automatic Backup        ¤n&quot;
    printf &quot;¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤n&quot;
    printf &quot;nWhich folder would you like to backup ?n&quot;
    select SITE in &quot;mywebsite&quot; &quot;myblog&quot; &quot;myforum&quot; &quot;quit&quot; ; do
    if [ -z &quot;${SITE}&quot; ]; then
        printf &quot; Enter a number.&quot;
    else

        # My Website
        if [ &quot;${SITE}&quot; = &quot;mywebsite&quot; ]; then
            SITE_DIR=/home/user/www/${SITE}
            DB_NAME=mywebsitedbname
            DB_USER=mywebsitedbuser
            DB_PASS=mywebsitedbpass
            DB_HOST=mywebsitedbhost
            backupDB
            backupFiles
        fi

        # My Blog
        if [ &quot;${SITE}&quot; = &quot;myblog&quot; ]; then
            SITE_DIR=/home/user/www/${SITE}
            DB_NAME=myblogdbname
            DB_USER=myblogdbuser
            DB_PASS=myblogdbpass
            DB_HOST=myblogdbhost
            backupDB
            backupFiles
        fi

        # My Forum
        if [ &quot;${SITE}&quot; = &quot;myforum&quot; ]; then
            SITE_DIR=/home/user/www/${SITE}
            DB_NAME=myforumdbname
            DB_USER=myforumdbuser
            DB_PASS=myforumdbpass
            DB_HOST=myforumdbhost
            backupDB
            backupFiles
        fi

        # Quit
        if [ &quot;${SITE}&quot; = &quot;quit&quot; ]; then
            reset
            exit
        fi

        break
    fi
    echo
    done
}

backupInit
</pre>
<h3>How to use</h3>
<p>First you have to create the backups folder, for example /home/user/backups. Your websites would be in /home/user/www</p>
<p>Then open the script in your favorite editor and adapt it to your folders structure. Define the path to the backup folder you just created:</p>
<pre class="brush: bash;"># Define Backup folder
BACKUP_DIR = /home/user/backups</pre>
<p>Then on the line :</p>
<pre class="brush: bash;">select SITE in &quot;mywebsite&quot; &quot;myblog&quot; &quot;myforum&quot; &quot;quit&quot; ; do</pre>
<p>put the names of the folders your want to be able to backup. The three choices in this example would correspond to the following three folders on the server : <em>home/www/mywebsite</em>, <em>home/www/myblog</em> and <em>home/www/myforum</em></p>
<p>Once you have done that, edit each corresponding sections below :</p>
<pre class="brush: bash;"># My Website
if [ &quot;${SITE}&quot; = &quot;mywebsite&quot; ]; then
    SITE_DIR=/home/user/www/${SITE}
    DB_NAME=mywebsitedbname
    DB_USER=mywebsitedbuser
    DB_PASS=mywebsitedbpass
    DB_HOST=mywebsitedbhost
    backupDB
    backupFiles
fi</pre>
<p>In those paragraphs, make sure that <em>mywebsite</em> in <em>if [ "${SITE}" = "mywebsite" ]; then</em> corresponds to the folder name you defined just before.</p>
<p>Then enter the database infos in the four lines : <em>DB_NAME</em>, <em>DB_USER</em>, <em>DB_PASS</em> and <em>DB_HOST</em>.</p>
<p>Of course you can create as many choices as you want, depending on the number of folders / sites you want have in your backup script.</p>
<p>If you want to add a folder for a website that doesn&#8217;t have an associated database, just use this :</p>
<pre class="brush: bash;"># My Website without database
if [ &quot;${SITE}&quot; = &quot;mywebsitewithoutdb&quot; ]; then
    SITE_DIR=/home/user/www/${SITE}
    backupFiles
fi</pre>
<p>That&#8217;s it!  Now upload the script to your server (for example to /home/user/), then ssh to this folder and run the script with</p>
<pre class="brush: bash;">./backup.sh</pre>
<p>Once you have run the script, go check in the backups folder, you should see something like :</p>
<pre class="brush: bash;">mywebsite_www_082309.tar.gz
mywebsite_sql_082309.sql.bz2
</pre>
<p>For more security, after you have done your backups, you should delete the script from the server (as it contains all your login/passwords for your databases).</p>
<p>Download the script : <strong><a href="http://www.michaelwassmer.net/site/wp-content/uploads/backup.sh.zip"><em>backup.sh.zip</em></a></strong></p>
<p>I hope you like this little script, if you have any suggestions please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/blog/an-automated-backup-script-for-your-websites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Universun</title>
		<link>http://www.michaelwassmer.net/websites/universun/</link>
		<comments>http://www.michaelwassmer.net/websites/universun/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 09:44:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/?p=453</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/websites/universun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shockingly Big IE6 Warning plugin french transaltion</title>
		<link>http://www.michaelwassmer.net/blog/shockingly-big-ie6-warning-plugin-french-transaltion/</link>
		<comments>http://www.michaelwassmer.net/blog/shockingly-big-ie6-warning-plugin-french-transaltion/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 14:09:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[translation]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/?p=186</guid>
		<description><![CDATA[I sometimes use the Shockingly Big IE6 Warning plugin for Wordpress to tell people to upgrade their browser and get rid of this dangerous and prehistorical piece of software Internet Explorer 6. Why would you do this as a developer? Here are some good arguments.
Today I took some time to translate this neat little plugin [...]]]></description>
			<content:encoded><![CDATA[<p>I sometimes use the <a title="Incerteza" href="http://www.incerteza.org/blog/projetos/shockingly-big-ie6-warning/" target="_blank"><em>Shockingly Big IE6 Warning</em></a> plugin for <em>Wordpress</em> to tell people to upgrade their browser and get rid of <span style="text-decoration: line-through;">this dangerous and prehistorical piece of software</span> <em>Internet Explorer 6</em>. Why would you do this as a developer? <a title="Robert Nyman" href="http://robertnyman.com/2009/02/09/stop-developing-for-internet-explorer-6/" target="_blank">Here</a> are some good arguments.</p>
<p>Today I took some time to translate this neat little plugin into french.</p>
<p>You can download the translation here : <a href="http://www.michaelwassmer.net/site/wp-content/uploads/shockingly-big-ie6-warning-fr_FR.mo">shockingly-big-ie6-warning-fr_FR.mo</a></p>
<p><span style="text-decoration: underline;">Note</span> : The translation is based on version 1.6.3 of the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/blog/shockingly-big-ie6-warning-plugin-french-transaltion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Espaces Atypiques</title>
		<link>http://www.michaelwassmer.net/websites/espaces-atypiques/</link>
		<comments>http://www.michaelwassmer.net/websites/espaces-atypiques/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 11:20:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/site/?p=133</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/websites/espaces-atypiques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial : Creating a multilingual product catalog with Wordpress and WPML</title>
		<link>http://www.michaelwassmer.net/blog/tutorial-creating-a-multilingual-product-catalog-with-wordpress-and-wpml/</link>
		<comments>http://www.michaelwassmer.net/blog/tutorial-creating-a-multilingual-product-catalog-with-wordpress-and-wpml/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 10:08:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wpml]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/site/?p=149</guid>
		<description><![CDATA[Following a discussion on the WPML Forum, Amir invited me to write a guest tutorial post on the WPML blog.
You can read it here : Creating a multilingual product catalog with Wordpress and WPML
]]></description>
			<content:encoded><![CDATA[<p>Following <a title="WPML" href="http://forum.wpml.org/topic.php?id=376" target="_blank">a discussion</a> on the <em>WPML Forum</em>, <strong>Amir</strong> invited me to write a guest tutorial post on the WPML blog.</p>
<p>You can read it here : <a title="WPML" href="http://wpml.org/2009/09/creating-a-multilingual-product-catalog/" target="_blank">Creating a multilingual product catalog with Wordpress and WPML</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/blog/tutorial-creating-a-multilingual-product-catalog-with-wordpress-and-wpml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Le Palais d&#8217;Agadir</title>
		<link>http://www.michaelwassmer.net/websites/le-palais-dagadir/</link>
		<comments>http://www.michaelwassmer.net/websites/le-palais-dagadir/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:50:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/site/?p=144</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/websites/le-palais-dagadir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Le Nogentel Hôtel</title>
		<link>http://www.michaelwassmer.net/websites/le-nogentel-hotel/</link>
		<comments>http://www.michaelwassmer.net/websites/le-nogentel-hotel/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:47:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/site/?p=140</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/websites/le-nogentel-hotel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La Photo Aérienne</title>
		<link>http://www.michaelwassmer.net/websites/la-photo-aerienne/</link>
		<comments>http://www.michaelwassmer.net/websites/la-photo-aerienne/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:44:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.michaelwassmer.net/site/?p=137</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.michaelwassmer.net/websites/la-photo-aerienne/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
