<?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>Void And Any &#187; sudo</title>
	<atom:link href="http://voidandany.free.fr/index.php/tag/sudo/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Sauvegarder un PC Windows avec rSnapshot, configuration complète</title>
		<link>http://voidandany.free.fr/index.php/sauvegarder-un-pc-windows-avec-rsnapshot-configuration-complete/</link>
		<comments>http://voidandany.free.fr/index.php/sauvegarder-un-pc-windows-avec-rsnapshot-configuration-complete/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 10:22:25 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[réseau]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=1154</guid>
		<description><![CDATA[Pour sauvegarder un PC Windows avec rSnapshot, il existe 3 (au moins) grandes méthodes : Monter un démon rsync sous Windows et faire une sauvegarde comme si il s&#8217;agissait d&#8217;un PC Linux Monter un partage Windows via Samba, et sauvegarder &#8230; <a href="http://voidandany.free.fr/index.php/sauvegarder-un-pc-windows-avec-rsnapshot-configuration-complete/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Pour sauvegarder un PC Windows avec rSnapshot, il existe 3 (au moins) grandes méthodes :</p>
<ul>
<li>Monter un <strong>démon rsync</strong> sous Windows et faire une sauvegarde comme si il s&#8217;agissait d&#8217;un PC Linux</li>
<li>Monter un <strong>partage Windows via Samba</strong>, et sauvegarder le partage comme un répertoire local</li>
<li>Ajouter le support NFS sous Windows</li>
</ul>
<p><br class="spacer_" /></p>
<p>J&#8217;ai personnellement testé les deux premières, mais je n&#8217;ai réussi à mettre en œuvre de façon acceptable que la deuxième solution.</p>
<p><br class="spacer_" /></p>
<p>Comme pour l&#8217;article Samba, je rédige le présent post à partir de notes prises au moment de la mise en œuvre de la solution, je ne peux plus vérifier les configurations décrites ici n&#8217;ayant plus de PC sous Windows.</p>
<p><br class="spacer_" /></p>
<h3>Démon rsync sous Windows</h3>
<p>Pour avoir un serveur rsync sous Windows il faut passser par <a href="http://www.cygwin.com/">cygwin</a> qui est un package qui met à disposition des utilisateurs Windows les principaux outils Linux existant dont rsync.</p>
<p><br class="spacer_" /></p>
<p>Je ne voulais pas installer cygwin j&#8217;ai donc trouvé <strong>2 packages rsync indépendant</strong> (se basant tout de même sur cygwin, mais avec le strict minimum)</p>
<ul>
<li><a href="http://itefix.no/cwrsync/">cwRsync</a></li>
<li><a href="http://sourceforge.net/projects/backuppc/files/cygwin-rsyncd/">RsyncD</a> maintenu par les équipes de <a href="http://backuppc.sourceforge.net/">BackupPC</a></li>
</ul>
<p>Le premier étant plus automatisé que le second.</p>
<p><br class="spacer_" /></p>
<p>J&#8217;ai testé les 2 et je me suis heurté au même problème de non <strong>préservation des accents</strong> dans les noms de fichiers.</p>
<p>Il est logique que ces 2 packages aient le même comportement concernant les accents, puisque ce dernier est inhérent à <strong>cygwin qui ne gère pas l&#8217;UTF8</strong></p>
<p><strong> </strong></p>
<p>J&#8217;ai bien tenter d&#8217;appliquer une <a href="http://www.okisoft.co.jp/esc/utf8-cygwin/">dll patchée de cygwin sensé ajouter le support de l&#8217;UTF8</a> à ce dernier mais sans succès.</p>
<p>Ce problème d&#8217;accent étant bloquant je n&#8217;ai pas persévéré avec cette solution.</p>
<p><br class="spacer_" /></p>
<p>Pour en savoir plus sur la mise en œuvre consulter cet article :</p>
<p><a href="http://www.stillnetstudios.com/snapshot-backups-howto/">http://www.stillnetstudios.com/snapshot-backups-howto/</a></p>
<p><br class="spacer_" /></p>
<h3>Partage Samba</h3>
<p>Dans cette solution le pré-requis est d&#8217;avoir <a href="http://voidandany.free.fr/index.php/installation-et-parametrage-de-base-de-samba/"><strong>Samba d&#8217;installé et configuré</strong></a> sur le serveur de sauvegarde.</p>
<p><br class="spacer_" /></p>
<p>Ensuite on <strong>monte le partage Windows</strong> voulu dans le point de montage de son choix avec la commande mount :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> cifs <span style="color: #000000; font-weight: bold;">//</span>adresse_ip_machine_windows<span style="color: #000000; font-weight: bold;">/</span>partage <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #660033;">-o</span> <span style="color: #007800;">username</span>=utilisateur_windows,<span style="color: #007800;">password</span>=mot_de_passe,<span style="color: #007800;">iocharset</span>=utf8,noperm</pre></div></div>

<p><br class="spacer_" /></p>
<p>Dans mon cas le partage Windows était le partage administratif du disque dur contenant les données à sauvegarder (D$) et mon utilisateur était membre du groupe Administrateur.</p>
<p>L&#8217;option iocharset permet de spécifier <strong>l&#8217;encodage des noms de fichier (UTF8)</strong> pour prendre en compte les accents et noperm indique qu&#8217;il ne faut pas vérifier les droits sur les fichiers</p>
<p><br class="spacer_" /></p>
<p>Après la saisie de la commande, normalement votre partage (D: dasn mon cas) devrait être accessible dans votre point de montage /mnt.</p>
<p><br class="spacer_" /></p>
<h4>Fichier rsnapshot</h4>
<p>Le fichier de configuration rSnapshot utilisé est peut différent de celui décrit pour la sauvegarde des machine Linux.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">################################################# </span>
<span style="color: #666666; font-style: italic;"># rsnapshot.conf - rsnapshot configuration file # </span>
<span style="color: #666666; font-style: italic;">################################################# </span>
<span style="color: #666666; font-style: italic;"># # </span>
<span style="color: #666666; font-style: italic;"># PLEASE BE AWARE OF THE FOLLOWING RULES: # </span>
<span style="color: #666666; font-style: italic;"># # </span>
<span style="color: #666666; font-style: italic;"># This file requires tabs between elements # </span>
<span style="color: #666666; font-style: italic;"># # </span>
<span style="color: #666666; font-style: italic;"># Directories require a trailing slash: # </span>
<span style="color: #666666; font-style: italic;"># right: /home/ # </span>
<span style="color: #666666; font-style: italic;"># wrong: /home # </span>
<span style="color: #666666; font-style: italic;"># # </span>
<span style="color: #666666; font-style: italic;">#################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;">####################### </span>
<span style="color: #666666; font-style: italic;"># CONFIG FILE VERSION # </span>
<span style="color: #666666; font-style: italic;">#######################</span>
&nbsp;
config_version <span style="color: #000000;">1.2</span>
&nbsp;
<span style="color: #666666; font-style: italic;">########################### </span>
<span style="color: #666666; font-style: italic;"># SNAPSHOT ROOT DIRECTORY # </span>
<span style="color: #666666; font-style: italic;">###########################</span>
&nbsp;
snapshot_root <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>sauvegardes<span style="color: #000000; font-weight: bold;">/</span>sweetHome<span style="color: #000000; font-weight: bold;">/</span> 
no_create_root <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################################# </span>
<span style="color: #666666; font-style: italic;"># EXTERNAL PROGRAM DEPENDENCIES # </span>
<span style="color: #666666; font-style: italic;">################################# </span>
cmd_cp <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cp</span> 
cmd_rm <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">rm</span> 
cmd_rsync <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>rsync 
cmd_ssh <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><span style="color: #c20cb9; font-weight: bold;">ssh</span> 
cmd_logger <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>logger 
cmd_du <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><span style="color: #c20cb9; font-weight: bold;">du</span> 
cmd_rsnapshot_diff <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>rsnapshot-diff 
<span style="color: #666666; font-style: italic;">#cmd_preexec /path/to/preexec/script </span>
<span style="color: #666666; font-style: italic;">#cmd_postexec /path/to/postexec/script</span>
&nbsp;
<span style="color: #666666; font-style: italic;">######################################### </span>
<span style="color: #666666; font-style: italic;"># BACKUP INTERVALS # </span>
<span style="color: #666666; font-style: italic;"># Must be unique and in ascending order # </span>
<span style="color: #666666; font-style: italic;"># i.e. hourly, daily, weekly, etc. # </span>
<span style="color: #666666; font-style: italic;">######################################### </span>
interval daily <span style="color: #000000;">7</span> 
interval weekly <span style="color: #000000;">4</span> 
interval monthly <span style="color: #000000;">2</span>
&nbsp;
<span style="color: #666666; font-style: italic;">############################################ </span>
<span style="color: #666666; font-style: italic;"># GLOBAL OPTIONS # </span>
<span style="color: #666666; font-style: italic;"># All are optional, with sensible defaults # </span>
<span style="color: #666666; font-style: italic;">############################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Verbose level : 1 (mini) through 5 (maxi). </span>
verbose <span style="color: #000000;">2</span> 
loglevel <span style="color: #000000;">3</span> 
logfile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>svc<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.log 
<span style="color: #c20cb9; font-weight: bold;">lockfile</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.pid
&nbsp;
rsync_long_args <span style="color: #660033;">--delete</span> <span style="color: #660033;">--numeric-ids</span> <span style="color: #660033;">--delete-excluded</span> <span style="color: #660033;">--chmod</span>=<span style="color: #007800;">ugo</span>=rwX 
ssh_args <span style="color: #660033;">-o</span> <span style="color: #007800;">BatchMode</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#include_file /path/to/include/file </span>
<span style="color: #666666; font-style: italic;">#exclude_file /path/to/exclude/file</span>
&nbsp;
<span style="color: #666666; font-style: italic;">############################### </span>
<span style="color: #666666; font-style: italic;">### BACKUP POINTS / SCRIPTS ### </span>
<span style="color: #666666; font-style: italic;">###############################</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sweetHome </span>
backup <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>Les 2 seuls différences concernent le <strong>point de sauvegarde</strong> (on spécifie ici que l&#8217;on sauvegarde un dossier local) et l&#8217;argument <strong>chmod</strong> de l&#8217;option rsync_long_args, où l&#8217;on indique qu&#8217;il faut changer les droits utilisateur de tous les fichiers sauvegardés pour y appliquer les droits en lecture, écriture et exécution pour tout le monde.</p>
<p><br class="spacer_" /></p>
<h4>Scripts de sauvegarde</h4>
<p>Pour finir mes scripts enchainant les diverses opération nécessaires à la sauvegarde du PC Windows :</p>
<ul>
<li>Allumage via WOL</li>
<li>Montage du partage</li>
<li>Sauvegarde</li>
<li>Démontage</li>
<li>Extinction</li>
</ul>
<p><br class="spacer_" /></p>
<p>/home/mon_user/bin/sauvegarde.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">DAY_OF_WEEKLY_BACKUP</span>=lundi 
<span style="color: #007800;">DAY_OF_MONTHLY_BACKUP</span>=01
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${0}</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Attente reveil sweetHome 
.<span style="color: #000000; font-weight: bold;">/</span>wakeOnLanSweetHome.sh 
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">60</span> 
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>mountSweetHome.sh
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Sauvegarde journaliere en cours... 
rsnapshot <span style="color: #660033;">-c</span> rsnapshotSweetHome.conf daily
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>A<span style="color: #7a0874; font-weight: bold;">&#41;</span> == <span style="color: #007800;">$DAY_OF_WEEKLY_BACKUP</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> Sauvegarde hebdomadaire en cours... 
rsnapshot <span style="color: #660033;">-c</span> rsnapshotSweetHome.conf weekly 
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #7a0874; font-weight: bold;">&#41;</span> == <span style="color: #007800;">$DAY_OF_MONTHLY_BACKUP</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> Sauvegarde mensuelle en cours... 
rsnapshot <span style="color: #660033;">-c</span> rsnapshotSweetHome.conf monthly 
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>umountSweetHome.sh 
<span style="color: #7a0874; font-weight: bold;">echo</span> Arret de sweetHome 
net rpc shutdown <span style="color: #660033;">-f</span> <span style="color: #660033;">-I</span> machine_distante <span style="color: #660033;">-U</span> utilisateur_distant<span style="color: #000000; font-weight: bold;">%</span>mot_de_passe <span style="color: #660033;">-t</span> <span style="color: #000000;">10</span> <span style="color: #660033;">-C</span> <span style="color: #ff0000;">&quot;Arrêt en cours...&quot;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>wakeOnLanSweetHome.sh est le même que celui mentionné dans <a rel="bookmark" href="http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-configuration-complete/">Sauvegarde avec rSnapshot, configuration complète</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Reveil de sweetHome 
wakeonlan mon_adresse_mac</pre></div></div>

<p><br class="spacer_" /></p>
<p>mountSweetHome.sh contient juste la commande de mount indiquée ci-dessus.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> montage <span style="color: #c20cb9; font-weight: bold;">du</span> lecteur D de sweetHome 
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> cifs <span style="color: #000000; font-weight: bold;">//</span>adresse_ip_machine_windows<span style="color: #000000; font-weight: bold;">/</span>partage <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #660033;">-o</span> <span style="color: #007800;">username</span>=utilisateur_windows,<span style="color: #007800;">password</span>=mot_de_passe,<span style="color: #007800;">iocharset</span>=utf8,noperm</pre></div></div>

<p><br class="spacer_" /></p>
<p>umountSweetHome.sh lui contient juste :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> demontage <span style="color: #c20cb9; font-weight: bold;">du</span> lecteur D de sweetHome 
<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetHome</pre></div></div>

<p><br class="spacer_" /></p>
<p>L&#8217;intérêt de mettre ces commandes simple dans des scripts bash est de pouvoir modifier le sudoer pour autoriser l&#8217;exécution de ces scripts sans mot de passe, évitant de mettre ce droit sur les commandes mount et umount directement.</p>
<p>Ainsi on pourra monter/demonter le partage Windows de sweetHome avec sudo sans mot de passe mais l&#8217;exécution de mount/umount pour monter/demonter autre chose necessitera toujours le mot de passe.</p>
<p><br class="spacer_" /></p>
<p>On aura donc dans sudoer :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mon_user ALL = NOPASSWD: mountSweetHome.sh, umountSweetHome.sh</pre></div></div>

<p>Et non pas :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mon_user ALL = NOPASSWD: <span style="color: #c20cb9; font-weight: bold;">mount</span>, <span style="color: #c20cb9; font-weight: bold;">umount</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /><strong><em><span style="text-decoration: underline;">Sources :</span></em></strong></p>
<p><a href="http://www.stillnetstudios.com/snapshot-backups-howto/">http://www.stillnetstudios.com/snapshot-backups-howto/</a></p>
<p>Démon rsync sur Windows</p>
<p><a href="http://blog.gingerlime.com/rsnapshot-server-on-windows">http://blog.gingerlime.com/rsnapshot-server-on-windows</a></p>
<p><a href="http://www.stillnetstudios.com/snapshot-backups-howto/">http://www.stillnetstudios.com/snapshot-backups-howto/</a></p>
<p>Démon rsync sur Windows &#8211; problèmes accent</p>
<p><a href="http://itefix.no/i2/node/11626?page=1#comment-14452">http://itefix.no/i2/node/11626?page=1#comment-14452</a></p>
<p><a href="http://forum.ubuntu-fr.org/viewtopic.php?id=141415">http://forum.ubuntu-fr.org/viewtopic.php?id=141415</a></p>
<p><a onclick="pageTracker._trackPageview('/outbound/comment/www.okisoft.co.jp');" rel="nofollow" href="http://www.okisoft.co.jp/esc/utf8-cygwin/">http://www.okisoft.co.jp/esc/utf8-cygwin/</a></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/sauvegarder-un-pc-windows-avec-rsnapshot-configuration-complete/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sauvegarde avec rSnapshot, configuration complète</title>
		<link>http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-configuration-complete/</link>
		<comments>http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-configuration-complete/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 16:20:30 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[réseau]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=1206</guid>
		<description><![CDATA[Cette article est la synthèse des précédents : Sauvegarde avec rSnapshot Sauvegarde avec rSnapshot via SSH et sudo Permission denied sur gvfs avec rSnapshot / rsync rSnapshot utilisation d&#8217;un fichier d&#8217;exclusion Il contient tous les scripts et configuration mis en &#8230; <a href="http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-configuration-complete/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Cette article est la synthèse des précédents :</p>
<ul>
<li><a href="http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot/">Sauvegarde avec rSnapshot</a></li>
<li><a href="http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-via-ssh-et-sudo/">Sauvegarde avec rSnapshot via SSH et sudo</a></li>
<li><a href="http://voidandany.free.fr/index.php/permission-denied-sur-gvfs-avec-rsnapshot-rsync/">Permission denied sur gvfs avec rSnapshot / rsync</a></li>
<li><a href="http://voidandany.free.fr/index.php/rsnapshot-utilisation-dun-fichier-dexclusion">rSnapshot utilisation d&#8217;un fichier d&#8217;exclusion</a></li>
</ul>
<p>Il contient tous les scripts et configuration mis en oeuvre pour la sauvegarde du home de ma machine sweetHome par sweetBox.</p>
<p><br class="spacer_" /></p>
<h3>Configuration du serveur de sauvegarde</h3>
<p>Tout d&#8217;abord je ne planifie pas chacun des intervals rSnapshot individuellement dans Cron, j&#8217;ai une seul tache appellant un script qui lui va &laquo;&nbsp;calculer&nbsp;&raquo; quel interval rSnapshot exécuter.</p>
<p>L&#8217;avantage, on éteint les machines à sauvegarder à la fin de l&#8217;exécution des tous les intervals, on pourrait même éteindre la machine réalisant la sauvegarde.</p>
<p><br class="spacer_" /></p>
<p>Voici ce script :</p>
<p>/home/mon_user/bin/sauvegarde.sh</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">DAY_OF_WEEKLY_BACKUP</span>=lundi
<span style="color: #007800;">DAY_OF_MONTHLY_BACKUP</span>=01
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${0}</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
. <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.profile
. wakeOnLanSweetHome.sh
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">120</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Sauvegarde journaliere en cours...
rsnapshot <span style="color: #660033;">-v</span> <span style="color: #660033;">-c</span> rsnapshotSweetHome.conf daily <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>svc<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.log <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>A<span style="color: #7a0874; font-weight: bold;">&#41;</span> == <span style="color: #007800;">$DAY_OF_WEEKLY_BACKUP</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> Sauvegarde hebdomadaire en cours...
rsnapshot <span style="color: #660033;">-v</span> <span style="color: #660033;">-c</span> rsnapshotSweetHome.conf weekly <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>svc<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.log <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #7a0874; font-weight: bold;">&#41;</span> == <span style="color: #007800;">$DAY_OF_MONTHLY_BACKUP</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> Sauvegarde mensuelle en cours...
rsnapshot <span style="color: #660033;">-v</span> <span style="color: #660033;">-c</span> rsnapshotSweetHome.conf monthly <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>svc<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.log <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mon_user<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.log <span style="color: #000000; font-weight: bold;">|</span> rsnapreport.pl <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> Sauvegarde mon_email
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh</span> mon_user<span style="color: #000000; font-weight: bold;">@</span>sweethome <span style="color: #ff0000;">&quot;shutdown -h now&quot;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>Ce script réveil sweetHome via <a href="http://voidandany.free.fr/index.php/demarrer-un-pc-via-le-reseau-wake-on-lan/">Wake on Lan,</a> lance la sauvegarde journalière puis hebdmadaire si on est un lundi, la mensuelle si on est un premier du mois.</p>
<p><br class="spacer_" /></p>
<p><em><span style="text-decoration: underline;">Edit 27/01/2010 :</span></em> Pour que le test sur le jour de la semaine fonctionne il faut que ce script soit exécuté dans un environnement pour lequel la langue est FR, or ce n&#8217;est pas le cas par défaut dans une tache Cron.</p>
<p>Il conviendra donc d&#8217;ajouter LANG=fr_FR.UTF-8 dnas l&#8217;en-tête de la crontab.</p>
<p>Cf. cet <a href="http://voidandany.free.fr/index.php/probleme-de-locale-langue-dans-un-script-plannifie-par-cron/">article</a></p>
<p><br class="spacer_" /></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">Puis le <a href="http://voidandany.free.fr/index.php/rsnapreport-rapports-de-sauvegarde-rsnapshot/">rapport de sauvegarde est formatté par rsnareport</a> et envoyé par mail, enfin on <a href="http://voidandany.free.fr/index.php/eteindre-un-pc-a-distance-depuis-linux/">éteint le pc à distance</a>.</span></span></p>
<p><br class="spacer_" /></p>
<p>Pour info le WOL est réalisé dans un script à part, ce qui me permet de réveiller sweetHome quand je veux sans avoir à me rappeler son adresse MAC, il est très succinct :</p>
<p><br class="spacer_" /></p>
<p>wakeOnLanSweetHome.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Reveil de sweetHome
wakeonlan mon_adresse_mac</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Ci-dessous mon fichier de configuration rsnapshot (purgé des commentaires) :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#################################################</span>
<span style="color: #666666; font-style: italic;"># rsnapshot.conf - rsnapshot configuration file #</span>
<span style="color: #666666; font-style: italic;">#################################################</span>
<span style="color: #666666; font-style: italic;"># #</span>
<span style="color: #666666; font-style: italic;"># PLEASE BE AWARE OF THE FOLLOWING RULES: #</span>
<span style="color: #666666; font-style: italic;"># #</span>
<span style="color: #666666; font-style: italic;"># This file requires tabs between elements #</span>
<span style="color: #666666; font-style: italic;"># #</span>
<span style="color: #666666; font-style: italic;"># Directories require a trailing slash: #</span>
<span style="color: #666666; font-style: italic;"># right: /home/ #</span>
<span style="color: #666666; font-style: italic;"># wrong: /home #</span>
<span style="color: #666666; font-style: italic;"># #</span>
<span style="color: #666666; font-style: italic;">#################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#######################</span>
<span style="color: #666666; font-style: italic;"># CONFIG FILE VERSION #</span>
<span style="color: #666666; font-style: italic;">#######################</span>
&nbsp;
config_version <span style="color: #000000;">1.2</span>
&nbsp;
<span style="color: #666666; font-style: italic;">###########################</span>
<span style="color: #666666; font-style: italic;"># SNAPSHOT ROOT DIRECTORY #</span>
<span style="color: #666666; font-style: italic;">###########################</span>
&nbsp;
snapshot_root <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>sauvegardes<span style="color: #000000; font-weight: bold;">/</span>sweetHome<span style="color: #000000; font-weight: bold;">/</span>
no_create_root <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#################################</span>
<span style="color: #666666; font-style: italic;"># EXTERNAL PROGRAM DEPENDENCIES #</span>
<span style="color: #666666; font-style: italic;">#################################</span>
cmd_cp <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cp</span>
cmd_rm <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">rm</span>
cmd_rsync <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>rsync
cmd_ssh <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><span style="color: #c20cb9; font-weight: bold;">ssh</span>
cmd_logger <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>logger
cmd_du <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><span style="color: #c20cb9; font-weight: bold;">du</span>
cmd_rsnapshot_diff <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>rsnapshot-diff
<span style="color: #666666; font-style: italic;">#cmd_preexec /path/to/preexec/script</span>
<span style="color: #666666; font-style: italic;">#cmd_postexec /path/to/postexec/script</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#########################################</span>
<span style="color: #666666; font-style: italic;"># BACKUP INTERVALS #</span>
<span style="color: #666666; font-style: italic;"># Must be unique and in ascending order #</span>
<span style="color: #666666; font-style: italic;"># i.e. hourly, daily, weekly, etc. #</span>
<span style="color: #666666; font-style: italic;">#########################################</span>
interval daily <span style="color: #000000;">7</span>
interval weekly <span style="color: #000000;">4</span>
interval monthly <span style="color: #000000;">2</span>
&nbsp;
<span style="color: #666666; font-style: italic;">############################################</span>
<span style="color: #666666; font-style: italic;"># GLOBAL OPTIONS #</span>
<span style="color: #666666; font-style: italic;"># All are optional, with sensible defaults #</span>
<span style="color: #666666; font-style: italic;">############################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Verbose level : 1 (mini) through 5 (maxi).</span>
verbose <span style="color: #000000;">2</span>
loglevel <span style="color: #000000;">3</span>
logfile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>svc<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.log
<span style="color: #c20cb9; font-weight: bold;">lockfile</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>rsnapshot.pid
&nbsp;
rsync_long_args <span style="color: #660033;">--delete</span> <span style="color: #660033;">--numeric-ids</span> <span style="color: #660033;">--relative</span> <span style="color: #660033;">--delete-excluded</span> <span style="color: #660033;">--stats</span>
ssh_args <span style="color: #660033;">-o</span> <span style="color: #007800;">BatchMode</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#exclude .gvfs</span>
<span style="color: #666666; font-style: italic;">#include_file /path/to/include/file</span>
exclude_file <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mon_user<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rsnapshotExclude
&nbsp;
<span style="color: #666666; font-style: italic;">###############################</span>
<span style="color: #666666; font-style: italic;">### BACKUP POINTS / SCRIPTS ###</span>
<span style="color: #666666; font-style: italic;">###############################</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sweetHome</span>
backup mon_user<span style="color: #000000; font-weight: bold;">@</span>sweethome:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user_distant <span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #007800;">class</span>=<span style="color: #ff0000;">&quot;spacer_&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></pre></div></div>

<p>Le fichier d&#8217;exclusion contient ceci :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Trash<span style="color: #000000; font-weight: bold;">/</span>
.thumbnails<span style="color: #000000; font-weight: bold;">/</span>
.mozilla<span style="color: #000000; font-weight: bold;">/*/*/</span>Cache<span style="color: #000000; font-weight: bold;">/</span>
.gvfs
tmp<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Afin d&#8217;avoir une <a href="http://voidandany.free.fr/index.php/simplifier-les-connexions-ssh/">connexion SSH sans mot de passe</a>, j&#8217;ai généré un couple de clés stockés dans /home/mon_user/.ssh.</p>
<p><br class="spacer_" /></p>
<p>Pour <a href="http://voidandany.free.fr/index.php/simplifier-les-connexions-ssh/">simplifier la synthaxe SSH</a>, j&#8217;ai ensuite créé un fichier config :</p>
<p>/home/mon_user/.ssh/config</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Host sweethome
Hostname 192.168.1.100
User mon_user</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Configuration de la machine sauvegardée</h3>
<p><br class="spacer_" /></p>
<p>La clé publique généré sur le serveur de sauvegarde à été <a href="http://voidandany.free.fr/index.php/simplifier-les-connexions-ssh/">copié dans authorized_key</a> sur la machine sauvegardée, et modifiée ainsi :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">from</span>=<span style="color: #ff0000;">&quot;IP_sweetBox&quot;</span>,<span style="color: #007800;">command</span>=<span style="color: #ff0000;">&quot;/home/user_distant/bin/validate-rsync&quot;</span> ssh-rsa AAAAB3...VJpj9<span style="color: #007800;">cjzjPTyYcXgGiQ</span>== <span style="color: #000000; font-weight: bold;">&lt;</span>a <span style="color: #007800;">href</span>=<span style="color: #ff0000;">&quot;mailto:mon_user@sweetBox&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>mon_user<span style="color: #000000; font-weight: bold;">@</span>sweetBox<span style="color: #000000; font-weight: bold;">&lt;/</span>a<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>On indique ainsi que cette clé utilisable que pour une connexion venant de l&#8217;IP from et que l&#8217;on exécute le script validate_rsync lors de l&#8217;établissement de cette connexion SSH.</p>
<p><br class="spacer_" /></p>
<p>Ce script de validation s&#8217;assure que la connexion SSH n&#8217;est établie que pour les commandes rsync (pour la sauvegarde) et/ou shutdown (pour éteindre sweetHome à la fin de la sauvegarde :</p>
<p>bin/validate-rsync</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSH_ORIGINAL_COMMAND</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
<span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #000000; font-weight: bold;">&amp;*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</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: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #000000; font-weight: bold;">&lt;*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</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: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</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: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
rsync\ --server<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #007800;">$SSH_ORIGINAL_COMMAND</span>
<span style="color: #000000; font-weight: bold;">;;</span>
shutdown\ -h\ now<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #007800;">$SSH_ORIGINAL_COMMAND</span>
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>On le voit ici que les commande rsync et shutdown sont précédées de sudo pour les exécuter en super-utilisateur.</p>
<p><br class="spacer_" /></p>
<p>Il convient donc de modifier le sudoer (sudo visudo) pour autoriser l&#8217;utilisateur de sweetHome réalisant la sauvegarde (utilisateur que j&#8217;ai décrit comme utilisateur distant vis a vis de sweetBox qui est ma référence) ait le droit de lancer sudo pour ces 2 commandes sans mot de passe.</p>
<p><br class="spacer_" /></p>
<p>J&#8217;ai donc ajouté cette ligne à mon sudoer :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mon_user ALL = NOPASSWD: <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>rsync, <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>shutdown</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Et voila..</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><em><strong>Edit : </strong></em></span></p>
<p>10/11/2009 : ajout de l&#8217;option &#8211;relative aux paramètres rsync et mise à jour de la variable rsnapshot exclude_file</p>
<p>27/01/2010 : Ajout de la remarque concernant le langue du script de sauvegarde dans le cadre d&#8217;une exécution via Cron</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-configuration-complete/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sauvegarde avec rSnapshot via SSH et sudo</title>
		<link>http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-via-ssh-et-sudo/</link>
		<comments>http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-via-ssh-et-sudo/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 18:50:23 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[réseau]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=1143</guid>
		<description><![CDATA[Lorsque l&#8217;on veut faire une sauvegarde d&#8217;une machine distante avec rSnapshot, on a plusieurs choix : Monter un partage Samba Monter un partage NFS Passer à travers SSH La dernière solution à bien sûr ma préférence : sécurisé j&#8217;ai déja &#8230; <a href="http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-via-ssh-et-sudo/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lorsque l&#8217;on veut faire une sauvegarde d&#8217;une machine distante avec rSnapshot, on a plusieurs choix :</p>
<ul>
<li>Monter un partage Samba</li>
<li>Monter un partage NFS</li>
<li>Passer à travers SSH</li>
</ul>
<p><br class="spacer_" /></p>
<p>La dernière solution à bien sûr ma préférence :</p>
<ul>
<li>sécurisé</li>
<li>j&#8217;ai déja openssh-server d&#8217;installé sur les machines à sauvegarder, je n&#8217;ai donc rien d&#8217;autre à installer.</li>
</ul>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Au niveau utilisateur j&#8217;ai créé  :</p>
<ul>
<li>un utilisateur sur le serveur de sauvegarde (sweetBox) qui lancera rSnapshot : on l&#8217;appelera user_rsnapshot</li>
<li>un utilisateur sur la/les machines à sauvegarder (swettHome) : on l&#8217;appelera user_distant</li>
</ul>
<p><br class="spacer_" /></p>
<p>L&#8217;utilisateur user_rsnapshot a un repertoire dont il est propriétaire sous /var/log à des fin de log.</p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><em><strong>Remarque : </strong></em></span>cet article appliqué a sudo marche tout aussi bien si vous l&#8217;appliquez à rsync directement.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Connexion SSH sans mot de passe</h3>
<p><br class="spacer_" /></p>
<p>On se basera sur l&#8217;article <a rel="bookmark" href="http://voidandany.free.fr/index.php/simplifier-les-connexions-ssh/">Simplifier les connexions SSH</a> dont je rappelle ici les grandes lignes</p>
<ul>
<li>connexion avec user_rsnapshot</li>
<li>génération d&#8217;une paire de clé</li>
<li>copie de la clé publique généré dans le authorized_key de user_distant</li>
<li>connexion à l&#8217;ordinateur distant avec user_distant afin d&#8217;ajouter l&#8217;empreinte de l&#8217;ordinateur distant à sauvegarder dans la liste des ordinateurs connus</li>
</ul>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Configuration de rSnapshot</h3>
<p><br class="spacer_" /></p>
<p>Création d&#8217;un fichier de configuration rsnapshot dans le home de user_rsnapshot, voir pour cela voir <a rel="bookmark" href="http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot/">Sauvegarde avec rSnapshot</a>.</p>
<p><br class="spacer_" /></p>
<p>Dans la section sauvegarde de ce fichier, mettre une ligne de la forme (avec des tabulations) :</p>
<pre>backup       user_distant@machine_a_sauvegarder:/repertoire_a_sauvegarder       destination</pre>
<p><br class="spacer_" /></p>
<p>La syntaxe de la source est la même syntaxe que lors de la copie de fichier via scp, enfin la destination est optionnelle (penser tout de même à mettre la tabulation)</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Test</h3>
<p><br class="spacer_" /></p>
<p>Faire un test en modifiant par exemple votre fichier de configuration pour ne sauvegarder qu&#8217;un petit répertoire (le Bureau par exemple), ainsi le test sera plus rapide que si lancez directement la sauvegarde de tous votre home de x Go.</p>
<p><br class="spacer_" /></p>
<p>Lancer rSnapshot :</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsnapshot <span style="color: #660033;">-v</span> <span style="color: #660033;">-c</span> fichier.conf daily</pre></div></div>

</p>
<p><br class="spacer_" /></p>
<p>Normalement tout devrait bien se passer (pas de message d&#8217;erreur) et la connexion SSH devrait se faire demander de mot de passe.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Restriction SSH et sauvegarde avec sudo</h3>
<p><br class="spacer_" /></p>
<p>On va désormais paramétrer la machine à sauvegarder pour n&#8217;autoriser la connexion SSH que lors de la sauvegarde et faire en sorte que rsync côté client (c&#8217;est à dire la machine sauvegardé) tourne en sudo permettant ainsi la sauvegarde de tous les répertoires voulus sur la machine clientes y compris ceux pour lesquelles l&#8217;utilisateur user_distant n&#8217;a pas de droits.</p>
<p><br class="spacer_" /></p>
<p>Se connecter (physiquement ou en SSH) sur la machine à sauvegarder avec l&#8217;utilisateur user_distant.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h4>Script de validation de la commande SSH</h4>
<p><br class="spacer_" /></p>
<p>Créer un script où vous le souhaitez que l&#8217;on nommera (au choix) validate-rsync, y copier ceci :</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSH_ORIGINAL_COMMAND</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
 <span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #000000; font-weight: bold;">&amp;*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 <span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 <span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</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: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 <span style="color: #000000; font-weight: bold;">*</span>\<span style="color: #000000; font-weight: bold;">&lt;*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</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: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</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: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 rsync\ --server<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #007800;">$SSH_ORIGINAL_COMMAND</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Rejected&quot;</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 <span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Ce script test la variable d&#8217;environnement $SSH_ORIGINAL_COMMAND (créée lors de la connexion SSH) et rejette toutes les connexions SSH dont la commande est différente de rsync &#8211;server.</p>
<p>La connexion SSH est donc impossible pour les usage autre que la sauvegarde.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h4>Appel du script de validation</h4>
<p><br class="spacer_" /></p>
<p>Il faut maintenant indiquer a SSH d&#8217;appeller ce script lors de la connexion, cela se fait dans authorized_keys.</p>
<p>Nous avons vus dans <a rel="bookmark" href="../index.php/simplifier-les-connexions-ssh/">Simplifier les connexions SSH</a> que nous pouvions grâce à authorized_keys limiter les connexions SSH à certaine adresse IP, nous allons ici rediriger notre connexion SSH vers notre script de validation :</p>
<p>Éditer votre fichier authorized_keys :</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys</pre></div></div>

</p>
<p><br class="spacer_" /></p>
<p>Et ajouter au début le mot-clé command suivi du chemin vers votre script de validation :</p>
<p><br class="spacer_" /></p>
<pre>from="192.168.1.222",command="/home/user_distant/bin/validate-rsync" ssh-rsa AAAAB3NzaC1yc2EAAA  ... VJpj9cjzjPTyYcXgGiQ== user_distant@machine_a_sauvegarder </pre>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h4>Exécution en tant que sudo</h4>
<p><br class="spacer_" /></p>
<p>Pour que votre sauvegarde puisse accéder à tous les répertoire de votre filesystem, il faut que rsync soit lancé en sudo.</p>
<p>Dans le script validate-rsync ci-dessous vous pourrer remarque que lorsque que la commande SSH est accepter, on ne se contente pas de l&#8217;exécuter, mais on a précédé la variable d&#8217;environnement $SSH_ORIGINAL_COMMAND de sudo</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsync\ --server<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #007800;">$SSH_ORIGINAL_COMMAND</span>
 <span style="color: #000000; font-weight: bold;">;;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>Il faut ensuite paramétrer le fichier sudoer pour autoriser votre utilisateur à lancer rsync via sudo sans demander de mot de passe.</p>
<p><br class="spacer_" /></p>
<p>Si votre utilisateur user_distant n&#8217;est pas déjà autorisé dans sudo (ce qui est certainement le cas si vous venez juste de le créer pour la sauvegarde), il vous faudra vous connecter avec votre utilisateur principal (ou faire un su).</p>
<p>On entre ensuite dans le fichier sudoer via visudo :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> visudo</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Et ajoutera une ligne du genre :</p>
<pre>svc ALL = NOPASSWD: /usr/bin/rsync</pre>
<p><br class="spacer_" /></p>
<p>Indiquant que l&#8217;utilisateur user_distant à le droit d&#8217;utiliser sudo sans mot de passe (NOPASSWD) pour la commande rsync et ce quel que soit la machine sur laquelle il est (ALL)</p>
<p><br class="spacer_" /></p>
<h3>Test</h3>
<p><br class="spacer_" /></p>
<p>Sur le serveur de sauvegarde , re-lancer rSnapshot comme lors du test précédent :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsnapshot <span style="color: #660033;">-v</span> <span style="color: #660033;">-c</span> fichier.conf daily</pre></div></div>

<p><br class="spacer_" /></p>
<p>Il ne devrait pas y avoir de changement par rapport au test précédent si ce n&#8217;est que vous pouvez désormais suavegarde le home ou le bureau d&#8217;un uatilisateur autre que l&#8217;utisateur user_distant.</p>
<p><br class="spacer_" /></p>
<p>On va en plus faire un test pour valider le bridage SSH en saisissant la commande :</p>
<p><br class="spacer_" /></p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> user_distant<span style="color: #000000; font-weight: bold;">@</span>machine_distante <span style="color: #c20cb9; font-weight: bold;">ls</span></pre></div></div>

</p>
<p><br class="spacer_" /></p>
<p>Au lieu de nous donner le contenu d&#8217;un répertoire (normalement le home de user_distant), on a :</p>
<p><br class="spacer_" /></p>
<pre>
 Rejected</pre>
<p><br class="spacer_" /></p>
<p>Nous indiquant que la connexion SSH est interdite pour autre chose de la sauvegarde avec rsync.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span></p>
<p>Le site de référence : <a href="http://troy.jdmz.net/rsnapshot/">http://troy.jdmz.net/rsnapshot/</a></p>
<p>Modification du précédent pour appliquer le sudo : <a href="http://www.pervasive-network.org/SPIP/Backup-incremental-avec-rsnapshot">http://www.pervasive-network.org/SPIP/Backup-incremental-avec-rsnapshot</a></p>
<p><a href="http://www.ruzee.com/blog/2008/11/using-rsnapshot-for-file-and-database-backups">http://www.ruzee.com/blog/2008/11/using-rsnapshot-for-file-and-database-backups</a></p>
<p><a href="http://blog.innerewut.de/2005/6/3/follow-up-on-remote-filesystem-snapshots-with-rsnapshot">http://blog.innerewut.de/2005/6/3/follow-up-on-remote-filesystem-snapshots-with-rsnapshot</a></p>
<p><a href="http://www.maxsworld.org/index.php/how-tos/rsnapshot-backups">http://www.maxsworld.org/index.php/how-tos/rsnapshot-backups</a></p>
<p><a href="http://blog.mageekbox.net/?post/2008/11/07/Mise-en-place-de-sauvegardes-%C3%A0-l-aide-de-rsnapshot">http://blog.mageekbox.net/?post/2008/11/07/Mise-en-place-de-sauvegardes-%C3%A0-l-aide-de-rsnapshot</a></p>
<p><a href="http://blog.innerewut.de/2005/5/25/remote-filesystem-snapshots-with-rsnapshot">http://blog.innerewut.de/2005/5/25/remote-filesystem-snapshots-with-rsnapshot</a></p>
<p><a href="http://geekfault.org/2009/05/16/rsnapshot/">http://geekfault.org/2009/05/16/rsnapshot/</a></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/sauvegarde-avec-rsnapshot-via-ssh-et-sudo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faire la redirection d&#8217;une commande exécutée avec sudo</title>
		<link>http://voidandany.free.fr/index.php/faire-la-redirection-dune-commande-executee-avec-sudo/</link>
		<comments>http://voidandany.free.fr/index.php/faire-la-redirection-dune-commande-executee-avec-sudo/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 14:47:41 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=1061</guid>
		<description><![CDATA[Admettons que l&#8217;on veuille exécuter une commande nécessitant une élévation de privilège via sudo (par exemple mount, shutdown, etc)  et que l&#8217;on veuille rediriger la sortie de cette commande dans un fichier appartenant à root nécessitant donc lui aussi une élévation de privilège &#8230; <a href="http://voidandany.free.fr/index.php/faire-la-redirection-dune-commande-executee-avec-sudo/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><br class="spacer_" /></p>
<p>Admettons que l&#8217;on veuille <strong>exécuter une commande</strong> nécessitant une élévation de privilège <strong>via sudo</strong> (par exemple mount, shutdown, etc)  et que l&#8217;on veuille <strong>rediriger la sortie</strong> de cette commande dans un <strong>fichier appartenant à root</strong> nécessitant donc lui aussi une élévation de privilège (un quelquonque fichier de /etc).</p>
<p><br class="spacer_" /></p>
<p>Si on fait la combinaison suivante, cela échouera :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> ma_commande <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> mon_fichier</pre></div></div>

<p><br class="spacer_" /></p>
<p>En effet le sudo &laquo;&nbsp;fait effet&nbsp;&raquo; sur ma_commande mais pas sur la redirection, 2 solutions pour palier à ce problème :</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>1 &#8211; Lancer un <strong>terminal en super-utilisateur</strong> et éxécuter la commande sans le sudo :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-s</span>
ma_commande <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> mon_fichier</pre></div></div>

<p><br class="spacer_" /></p>
<p>2 &#8211; Utiliser la <strong>commande bash</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;ma_commande &gt;&gt; mon_fichier&quot;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Pour info voici la commande qui m&#8217;a fait me poser cette question :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;mdadm --detail --scan &gt;&gt; /etc/mdadm/mdadm.conf&quot;</span></pre></div></div>

<p><strong> </strong></p>
<p><strong><span style="text-decoration: underline;">Edit : </span></strong></p>
<p>18/01/2010 : Une autre solution : <a href="http://linux.leunen.com/?p=780">http://linux.leunen.com/?p=780</a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/faire-la-redirection-dune-commande-executee-avec-sudo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
