<?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>Werk &#187; sauvegarde</title>
	<atom:link href="http://werk.feub.net/tag/sauvegarde/feed/" rel="self" type="application/rss+xml" />
	<link>http://werk.feub.net</link>
	<description>Pourquoi Werk? ^.^</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:18:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sauvegarder son compte Gmail avec getmail</title>
		<link>http://werk.feub.net/2011/05/sauvegarder-son-compte-gmail-avec-getmail/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sauvegarder-son-compte-gmail-avec-getmail</link>
		<comments>http://werk.feub.net/2011/05/sauvegarder-son-compte-gmail-avec-getmail/#comments</comments>
		<pubDate>Wed, 04 May 2011 14:24:21 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[fetchmail]]></category>
		<category><![CDATA[getmail]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[maildir]]></category>
		<category><![CDATA[mbox]]></category>
		<category><![CDATA[sauvegarde]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=772</guid>
		<description><![CDATA[getmail est un script en python écrit par Charles Cazabon qui permet de rapatrier les courriers d&#8217;une ou plusieurs boites aux lettres d&#8217;une façon simple (mais efficace). Selon les mots de son auteur, getmail est conçu pour être sécurisé, flexible, fiable et facile d&#8217;utilisation. Il est un remplaçant potentiel de fetchmail. Ce petit tutoriel est [...]]]></description>
			<content:encoded><![CDATA[<p>
<img src="http://werk.feub.net/medias/2011/05/gmail_red.png" alt="" class="floatleft" /><a href="http://pyropus.ca/software/getmail/">getmail</a> est un script en python écrit par Charles Cazabon qui permet de rapatrier les courriers d&#8217;une ou plusieurs boites aux lettres d&#8217;une façon simple (mais efficace). Selon les mots de son auteur, getmail est conçu pour être sécurisé, flexible, fiable et facile d&#8217;utilisation. Il est un remplaçant potentiel de <a href="http://fetchmail.berlios.de/">fetchmail</a>.
</p>
<p>
Ce petit tutoriel est fait sur une distribution <a href="http://www.centos.org/">CentOS</a> et c&#8217;est la procèdure de sauvegarde que j&#8217;utilise pour mon compte Gmail (Google Apps). La boite aux lettres de destination est de type <a href="https://secure.wikimedia.org/wikipedia/fr/wiki/Maildir">Maildir</a>, c&#8217;est-à-dire que chaque courrier est dans un fichier unique contrairement à <a href="https://secure.wikimedia.org/wikipedia/fr/wiki/Mbox">Mbox</a> qui place tous les courriers dans un fichier unique.
</p>
<p><span id="more-772"></span></p>
<h4>Installation de getmail</h4>
<p>
Choisissez votre gestionnaire de paquets préféré, pour les habitués des distributions à base de Red Hat, ce sera <em>yum</em> :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install getmail</span></pre></div></div>

<h4>Création des répertoires</h4>
<p>
Le script ne crée pas par lui-même les répertoires et fichiers nécessaires au bon fonctionnement de getmail, il faut donc les ajouter à la main. On commence par l&#8217;arborescence de type Maildir qui accueillera les emails :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>Maildir<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>new,tmp,cur<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>
Je ne m&#8217;attarde pas sur les trois répertoires <em>cur</em>, <em>tmp</em> et <em>new</em>, c&#8217;est l&#8217;arborescence de <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Maildir#Technical_operation">fonctionnement de Maildir</a>. Ensuite, il faut créer le répertoire qui contiendra le fichier de configuration et les logs de getmail :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>.getmail
$ <span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.getmail<span style="color: #000000; font-weight: bold;">/</span>gmailrc
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">700</span> ~<span style="color: #000000; font-weight: bold;">/</span>.getmail</pre></div></div>

<h4>Configuration</h4>
<p>
Voici mon fichier de configuration pour sauvegarder un compte <a href="http://www.google.com/apps/">Google Apps</a> en utilisant IMAP :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>retriever<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = SimpleIMAPSSLRetriever
server = imap.gmail.com
mailboxes = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;[Gmail]/All Mail&quot;</span>,<span style="color: #7a0874; font-weight: bold;">&#41;</span>
username = nom<span style="color: #000000; font-weight: bold;">@</span>domaine.net
password = mot_de_passe
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>destination<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = Maildir
path = ~<span style="color: #000000; font-weight: bold;">/</span>Maildir<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>options<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #666666; font-style: italic;"># Mode verbeux</span>
<span style="color: #666666; font-style: italic;"># 0 : n'affiche que les warnings et les erreurs</span>
<span style="color: #666666; font-style: italic;"># 1 : affiche les notifications de récupération et de suppression de messages</span>
<span style="color: #666666; font-style: italic;"># 2 : toutes les actions</span>
verbose = <span style="color: #000000;">2</span>
message_log = ~<span style="color: #000000; font-weight: bold;">/</span>.getmail<span style="color: #000000; font-weight: bold;">/</span>gmail.log
&nbsp;
<span style="color: #666666; font-style: italic;"># ne récupére que les nouveaux messages</span>
<span style="color: #666666; font-style: italic;"># idéal pour de la sauvegarde régulière</span>
read_all = <span style="color: #c20cb9; font-weight: bold;">false</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># n'altère pas les messages</span>
delivered_to = <span style="color: #c20cb9; font-weight: bold;">false</span>
received = <span style="color: #c20cb9; font-weight: bold;">false</span></pre></div></div>

<h4>Lancement du script</h4>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ getmail <span style="color: #660033;">-r</span> ~<span style="color: #000000; font-weight: bold;">/</span>.getmail<span style="color: #000000; font-weight: bold;">/</span>gmailrc</pre></div></div>

<p>
Le script commence le rapatriement des messages et les place dans l&#8217;arborescence Maildir.
</p>
<p>
<strong>Note</strong> : Google n&#8217;autorise le transfert que d&#8217;un nombre limité de messages à la fois, si votre boite aux lettres est assez importante il faut relancer cette commande plusieurs fois, car seuls les nouveaux messages sont récupérés, ou alors le faire de façon automatisée (voir ci-dessous).
</p>
<h4>Automatisation</h4>
<p>
Afin d&#8217;automatiser cette sauvegarde, un job peut être ajouté dans le <a href="https://secure.wikimedia.org/wikipedia/fr/wiki/Cron">cron</a>. L&#8217;option <em>-q</em> rend l&#8217;opération silentieuse, sauf pour les erreurs :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Le script est lancé à la 7ème minute de chaque heure ^.^</span>
<span style="color: #000000;">7</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>getmail <span style="color: #660033;">-q</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>fabien<span style="color: #000000; font-weight: bold;">/</span>.getmail<span style="color: #000000; font-weight: bold;">/</span>getmailrc</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2011/05/sauvegarder-son-compte-gmail-avec-getmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remontage de temps</title>
		<link>http://werk.feub.net/2008/02/remontage-de-temps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remontage-de-temps</link>
		<comments>http://werk.feub.net/2008/02/remontage-de-temps/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 05:02:00 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=44</guid>
		<description><![CDATA[Time Machine dans une situation réelle]]></description>
			<content:encoded><![CDATA[<p>
J&#8217;ai eu un petit soucis lors de la tentative d&#8217;installation de la dernière maj d&#8217;<a href="http://www.apple.com/fr/macosx/" title="Apple">OS X</a>, la 10.5.2, je n&#8217;ai tout bonnement pas pu l&#8217;installer car ma partition <i>system</i> manquait d&#8217;espace, Leopard me demandait 2,4Go pour l&#8217;installer. Pour info, j&#8217;ai deux partitions sur mon iBook : <i>system</i> et <i>data</i> (le(s) home(s)). C&#8217;était l&#8217;occasion de faire un petit ménage général en partitionnant différemment et en ré-installant tout.
</p>
<p>
Mais c&#8217;était aussi l&#8217;occasion d&#8217;essayer une restauration avec <a href="http://www.apple.com/fr/macosx/features/timemachine.html" title="Apple">Time Machine</a>! Je dois dire que cela marche plutôt bien, rien de bien folichon vous me direz, on demande juste de retrouver un(des) fichier(s), mais ça marche. Mon but n&#8217;était pas de restaurer un système entier avec Time Machine, seulement de récupérer mes documents, photos et des choses genre le Carnet d&#8217;adresses, mes bookmarks <a href="http://www.apple.com/fr/macosx/features/safari.html" title="Apple">Safari</a>, etc. J&#8217;ai bien aimé le fait de se retrouver au même endroit dans le <a href="http://www.apple.com/macosx/features/finder.html" title="Apple">Finder</a> où l&#8217;on a invoqué Time Machine dans l&#8217;arborescence (j&#8217;ai retourné cette phrase 36 fois sans arriver à être explicite..), par exemple je suis sous <i>~/Documents/2008/toto.txt</i>, lorsque je démarre Time Machine, il se place directement sous <i>~/Documents/2008/toto.txt</i> de la dernière sauvegarde.
</p>
<div class="image deport">
<img src="http://werk.feub.net/medias/2008/02/apple-time-machine.jpg" alt="Apple Time Machine" width="620" height="392" /><br />
Time Machine en action
</div>
<p>
Je suis maintenant bien en 10.5.2 et mon partitionnement et le suivant : 20Go pour <i>system</i> et le reste (environ 74Go) pour <i>data</i>. Pour ceux qui veulent faire des partitions et rediriger leur <i>home</i> sous Leopard, j&#8217;ai écris <a href="http://feub.net/werk/index.php/feubv9/netinfo_manager_ou_es_tu/" title="feub.net">une petite note</a> là-dessus il y a quelque temps.</p>
]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2008/02/remontage-de-temps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc (Feed is rejected)
Page Caching using apc
Object Caching 277/306 objects using memcached

Served from: werk.feub.net @ 2012-02-09 00:46:30 -->
