<?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; bash</title>
	<atom:link href="http://werk.feub.net/tag/bash/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>script : vérifier que rTorrent est lancé</title>
		<link>http://werk.feub.net/2008/12/script-verifier-que-rtorrent-est-lance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=script-verifier-que-rtorrent-est-lance</link>
		<comments>http://werk.feub.net/2008/12/script-verifier-que-rtorrent-est-lance/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 14:11:51 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[torrent]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=7</guid>
		<description><![CDATA[Bash check_rtorrent.sh]]></description>
			<content:encoded><![CDATA[<p>
Pour la gestion de mes torrents, j&#8217;utilise <a href="http://libtorrent.rakshasa.no/" title="rTorrent">rTorrent</a>, j&#8217;ai eu l&#8217;occasion d&#8217;en parler dans <a href="http://feub.net/werk/index.php/tic/commentaires/utiliser_rtorrent/" title="feub.net">ce billet</a> et <a href="http://feub.net/werk/index.php/tic/commentaires/rtorrent_deplacer_les_fichiers_telecharges/" title="feub.net">celui-ci</a>. Il s&#8217;agit d&#8217;un <a href="http://fr.wikipedia.org/wiki/Daemon" title="Wikipedia">daemon</a> très stable, mais pour des raisons X ou Y (genre redémarrage de la machine), j&#8217;oublie de le lancer. Pour palier à cela, j&#8217;ai écrit ce petit script qui vérifie que le programme est bien démarré, sinon il va tenter de le faire. Si tel est le cas, un email est envoyé pour signaler que rTorrent a été redémarré. Le tout est loggé.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Fichier de log</span>
<span style="color: #007800;">LOGPATH</span>=<span style="color: #ff0000;">&quot;/home/fabien/bin/log/check_rtorrent.log&quot;</span>
<span style="color: #666666; font-style: italic;"># Email</span>
<span style="color: #007800;">EMAIL</span>=<span style="color: #ff0000;">&quot;fabien@feub.net&quot;</span>
<span style="color: #007800;">SUBJECT</span>=<span style="color: #ff0000;">&quot;[check] rTorrent&quot;</span>
<span style="color: #666666; font-style: italic;"># Si pas de fichier de log, on le crée</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$LOGPATH</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #007800;">$LOGPATH</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #ff0000;">&quot; : Vérification que rTorrent est lancé...&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGPATH</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">pidof</span> rtorrent
<span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;en fonctionnement : OK&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGPATH</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;non démarré...&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGPATH</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;démarrage...&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGPATH</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>bin<span style="color: #000000; font-weight: bold;">/</span>btlaunch.sh
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;en fonctionnement : OK&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$LOGPATH</span>
mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SUBJECT</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$EMAIL</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$LOGPATH</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>
<img src="http://feub.net/werk/images/uploads/icons/icon16-script.png" class="ico16" height="16" width="16"> <a href="http://feub.net/werk/images/uploads/200812/check_rtorrent.sh" title="Télécharger check_rtorrent.sh">Télécharger check_rtorrent.sh</a>
</p>
<p>
Pour automatiser cela, je l&#8217;ajoute dans mon crontab pour qu&#8217;il vérifie toutes les 5 minutes :
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ crontab <span style="color: #660033;">-e</span>
<span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">5</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>home<span style="color: #000000; font-weight: bold;">/</span>fabien<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>check_rtorrent.sh</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2008/12/script-verifier-que-rtorrent-est-lance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>clavicogyre ver 1.5</title>
		<link>http://werk.feub.net/2008/08/clavicogyre-ver-1-5/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clavicogyre-ver-1-5</link>
		<comments>http://werk.feub.net/2008/08/clavicogyre-ver-1-5/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 06:09:33 +0000</pubDate>
		<dc:creator>Fabien</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[sauvegar]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://werk.feub.net/?p=30</guid>
		<description><![CDATA[Amélioration de mon petit bash de sauvegarde]]></description>
			<content:encoded><![CDATA[<p>
Je publie le petit script de backup maison que j&#8217;utilise depuis plusieurs années. Simple, à base de <a href="http://fr.wikipedia.org/wiki/Rsync" title="Wikipedia">rsync</a> au travers d&#8217;<a href="http://fr.wikipedia.org/wiki/SSH" title="SSHWikipedia">SSH</a>, il propose un petit menu pour ne sauvegarder que certaines partie de votre home (Images, Documents, Musique, etc), et possède l&#8217;option &#8211;delete de rsync facultative :
</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: #666666; font-style: italic;">#======================================================================</span>
<span style="color: #666666; font-style: italic;"># CLAVICOGYRE - Script de backup</span>
<span style="color: #666666; font-style: italic;">#======================================================================</span>
<span style="color: #666666; font-style: italic;"># by fabien a. [fabien@feub.net]</span>
<span style="color: #666666; font-style: italic;"># http://feub.net/</span>
<span style="color: #666666; font-style: italic;">#======================================================================</span>
<span style="color: #666666; font-style: italic;"># This program is free software; you can redistribute it and/or</span>
<span style="color: #666666; font-style: italic;"># modify it under the terms of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># as published by the Free Software Foundation; either version 2</span>
<span style="color: #666666; font-style: italic;"># of the License, or (at your option) any later version.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #666666; font-style: italic;"># GNU General Public License for more details.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You should have received a copy of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># along with this program; if not, </span>
<span style="color: #666666; font-style: italic;">#  - write to the Free Software</span>
<span style="color: #666666; font-style: italic;">#		Foundation, Inc.,</span>
<span style="color: #666666; font-style: italic;">#		51 Franklin Street,</span>
<span style="color: #666666; font-style: italic;">#		Fifth Floor,</span>
<span style="color: #666666; font-style: italic;">#		Boston, MA  02110-1301</span>
<span style="color: #666666; font-style: italic;">#		USA.</span>
<span style="color: #666666; font-style: italic;">#		- See http://www.gnu.org/licenses/gpl.html</span>
<span style="color: #666666; font-style: italic;">#======================================================================</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Numero de version</span>
<span style="color: #007800;">VERSION</span>=<span style="color: #ff0000;">&quot;ver 1.5.02 (01/08/2008)&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Chemin vers le serveur</span>
<span style="color: #007800;">SSHPATH</span>=<span style="color: #ff0000;">&quot;utilisateur@serveur:&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Chemins</span>
<span style="color: #007800;">PHOTOS_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/lightroom/&quot;</span>
<span style="color: #007800;">PHOTOS_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/Images/Photos&quot;</span>
<span style="color: #007800;">PICTURES_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/Pictures/&quot;</span>
<span style="color: #007800;">PICTURES_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/Images&quot;</span>
<span style="color: #007800;">DOCS_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/Documents/&quot;</span>
<span style="color: #007800;">DOCS_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/Documents&quot;</span>
<span style="color: #007800;">MUSIC_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/Music/iTunes/iTunes Music/&quot;</span>
<span style="color: #007800;">MUSIC_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/backup/Musique&quot;</span>
<span style="color: #007800;">WWW_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/www/&quot;</span>
<span style="color: #007800;">WWW_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/www&quot;</span>
<span style="color: #007800;">DEV_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/Dev/&quot;</span>
<span style="color: #007800;">DEV_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/Dev&quot;</span>
<span style="color: #007800;">BIN_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/bin/&quot;</span>
<span style="color: #007800;">BIN_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/Backup/bin&quot;</span>
<span style="color: #007800;">RESSOURCES_SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/Resources/&quot;</span>
<span style="color: #007800;">RESSOURCES_CIBLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SSHPATH</span>/home/fabien/Resources&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Date d'execution du script</span>
<span style="color: #007800;">JOUR</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: #666666; font-style: italic;">## + %d permet d'extraire le jour</span>
<span style="color: #007800;">MOIS</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>m<span style="color: #7a0874; font-weight: bold;">&#41;</span>	<span style="color: #666666; font-style: italic;">## +%m permet d'extraire le mois</span>
<span style="color: #007800;">ANNEE</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>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span> 	<span style="color: #666666; font-style: italic;">## +%y permet d'extraire l'annee</span>
<span style="color: #007800;">HEURE</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>H<span style="color: #7a0874; font-weight: bold;">&#41;</span>	<span style="color: #666666; font-style: italic;">## +%H permet d'extraire l'heure</span>
<span style="color: #007800;">MINUTES</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>M<span style="color: #7a0874; font-weight: bold;">&#41;</span>	<span style="color: #666666; font-style: italic;">## +%M permet d'extraire les minutes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Envoi du log par email</span>
<span style="color: #666666; font-style: italic;">#MAIL_DEST=&quot;adresse@email.net&quot;</span>
<span style="color: #666666; font-style: italic;">#MAIL_SUJET=&quot;[Backup] du $ANNEE-$MOIS-$JOUR a $HEUR:$MINUTES&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Rapport</span>
<span style="color: #007800;">RAPPORT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/Desktop/<span style="color: #007800;">$ANNEE</span><span style="color: #007800;">$MOIS</span><span style="color: #007800;">$JOUR</span>-clavicogyre-backup.log&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Les options sont :</span>
<span style="color: #666666; font-style: italic;"># v : verbose</span>
<span style="color: #666666; font-style: italic;"># r : rursif</span>
<span style="color: #666666; font-style: italic;"># u : update seulement</span>
<span style="color: #666666; font-style: italic;"># p : prerve les permissions</span>
<span style="color: #666666; font-style: italic;"># a : copie en tant qu'archive</span>
<span style="color: #666666; font-style: italic;"># t : prerve la date</span>
<span style="color: #666666; font-style: italic;"># --delete : supprime ce qui a ete supprime (copie stricte)</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Fonctions</span>
backup<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
&nbsp;
	<span style="color: #007800;">SOURCE</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
	<span style="color: #007800;">CIBLE</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
&nbsp;
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Backup <span style="color: #007800;">$SOURCE</span> ....&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------------------------&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> Backup <span style="color: #c20cb9; font-weight: bold;">du</span> dossier <span style="color: #800000;">${1}</span> <span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #007800;">$JOUR</span><span style="color: #ff0000;">'/'</span><span style="color: #007800;">$MOIS</span> \
              a <span style="color: #007800;">$HEURE</span><span style="color: #ff0000;">'h'</span><span style="color: #007800;">$MINUTES</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------------------------&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># Si option delete</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$3&quot;</span> = <span style="color: #ff0000;">&quot;DEL&quot;</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> <span style="color: #ff0000;">&quot;L'option --delete est activee, etes-vous sur? (O/[n])&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">read</span> ACTDEL
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ACTDEL</span>&quot;</span> = <span style="color: #ff0000;">&quot;O&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
		<span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #007800;">OPTDEL</span>=<span style="color: #ff0000;">&quot;--delete&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Option --delete ON&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #007800;">OPTDEL</span>=<span style="color: #ff0000;">&quot;&quot;</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Option --delete OFF&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #007800;">OPTDEL</span>=<span style="color: #ff0000;">&quot;&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;option --delete OFF&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
	<span style="color: #000000; font-weight: bold;">fi</span>	
&nbsp;
	<span style="color: #666666; font-style: italic;"># rsync</span>
	rsync <span style="color: #660033;">-vrupatz</span> <span style="color: #660033;">--exclude-from</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rsync_exclude.txt \
               <span style="color: #007800;">$OPTDEL</span> <span style="color: #660033;">-e</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${SOURCE}</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${CIBLE}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$RAPPORT</span> <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: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$RAPPORT</span>
&nbsp;
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Fin du backup.&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Un fichier de log se trouve ici : &quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$RAPPORT</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># On efface l'ecran</span>
<span style="color: #c20cb9; font-weight: bold;">clear</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;CLAVICOGYRE : SCRIPT DE BACKUP - <span style="color: #007800;">$VERSION</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Demande du repertoire a sauvegarder</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Repertoire a sauvegarder : &quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 1) Photos (Lightroom)&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 2) Pictures&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 3) Documents&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 4) Music&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 5) www&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 6) Dev&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 7) bin&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;=== 8) Resources&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;L'ajout de 'strict' ajoutera l'option --delete de rsync &quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;et effectuera ainsi une copie conforme.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;ATTENTION : a utiliser avec parcimonie, les fichiers&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;supprimes seront supprimes sur la sauvergarde egalement.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Exemple : 2 strict&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;fera une copie stricte du dossier Documents.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;----------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;---&gt; choix : &quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> REP
tput <span style="color: #c20cb9; font-weight: bold;">clear</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$REP</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$PHOTOS_SOURCE</span> <span style="color: #007800;">$PHOTOS_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;1 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$PHOTOS_SOURCE</span> <span style="color: #007800;">$PHOTOS_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$PICTURES_SOURCE</span> <span style="color: #007800;">$PICTURES_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;2 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$PICTURES_SOURCE</span> <span style="color: #007800;">$PICTURES_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$DOCS_SOURCE</span> <span style="color: #007800;">$DOCS_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;3 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$DOCS_SOURCE</span> <span style="color: #007800;">$DOCS_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$MUSIC_SOURCE</span> <span style="color: #007800;">$MUSIC_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;4 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$MUSIC_SOURCE</span> <span style="color: #007800;">$MUSIC_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$WWW_SOURCE</span> <span style="color: #007800;">$WWW_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;5 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$WWW_SOURCE</span> <span style="color: #007800;">$WWW_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;6&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$DEV_SOURCE</span> <span style="color: #007800;">$DEV_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;6 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$DEV_SOURCE</span> <span style="color: #007800;">$DEV_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;7&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$BIN_SOURCE</span> <span style="color: #007800;">$BIN_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;7 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$BIN_SOURCE</span> <span style="color: #007800;">$BIN_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$RESSOURCES_SOURCE</span> <span style="color: #007800;">$RESSOURCES_CIBLE</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #ff0000;">&quot;8 strict&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
	backup <span style="color: #007800;">$RESSOURCES_SOURCE</span> <span style="color: #007800;">$RESSOURCES_CIBLE</span> <span style="color: #ff0000;">&quot;DEL&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;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Aucun choix valide. Termine.&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Fin du script.&quot;</span></pre></div></div>

<p>
<a href="http://werk.feub.net/medias/2008/08/clavicogyre.sh" title="Télécharger clavicogyre.sh">Télécharger clavicogyre.sh</a>
</p>
<p>
Note : les anti-slash \ ne sont pas à taper, ils indiquent que j&#8217;ai coupé les lignes pour que ça ne dépasse pas du cadre. Il s&#8217;agit d&#8217;une seule et même ligne.
</p>
<p>
Note 2 : Oui <a href="http://www.sebweb.org/goldorak/armes.htm" title="clavicogyre">clavicogyre</a> est une arme de <a href="http://fr.wikipedia.org/wiki/Goldorak" title="Wikipedia">Goldorak</a> ;}</p>
]]></content:encoded>
			<wfw:commentRss>http://werk.feub.net/2008/08/clavicogyre-ver-1-5/feed/</wfw:commentRss>
		<slash:comments>4</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 237/285 objects using memcached

Served from: werk.feub.net @ 2012-02-09 00:22:59 -->
