<?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>The Troll&#039;s factory &#187; serveur</title>
	<atom:link href="http://trollfactory.fr/tag/serveur/feed" rel="self" type="application/rss+xml" />
	<link>http://trollfactory.fr</link>
	<description>Geekeries &#38; pensées</description>
	<lastBuildDate>Mon, 09 Jun 2014 19:43:25 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>S&#8217;identifier en SSH sans mot de passe à l&#8217;aide d&#8217;une clé RSA &#8212; SSHA Authentication without password using a RSA key</title>
		<link>http://trollfactory.fr/sidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382</link>
		<comments>http://trollfactory.fr/sidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382#comments</comments>
		<pubDate>Mon, 02 May 2011 11:55:36 +0000</pubDate>
		<dc:creator><![CDATA[Troll]]></dc:creator>
				<category><![CDATA[Administration serveur]]></category>
		<category><![CDATA[astuces]]></category>
		<category><![CDATA[Geekeries]]></category>
		<category><![CDATA[astuce]]></category>
		<category><![CDATA[clé publique]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[infogérance]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsa]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://trollfactory.fr/?p=382</guid>
		<description><![CDATA[Non seulement c&#8217;est plus sécurisé, mais en plus c&#8217;est quand même carrément plus pratique, voici comment configurer en 30 secondes (top chrono !) votre accès SSH sur votre serveur favoris à l&#8217;aide d&#8217;une clé RSA plutôt avec qu&#8217;un vieux mot de passe soit pas sécurisé, soit que vous n&#8217;arrivez pas à retenir : Générer la [...]]]></description>
				<content:encoded><![CDATA[<p>Non seulement c&rsquo;est plus sécurisé, mais en plus c&rsquo;est quand même carrément plus pratique,<strong> voici comment configurer en 30 secondes</strong> (top chrono !) votre accès SSH sur votre serveur favoris à l&rsquo;aide d&rsquo;une clé RSA plutôt avec qu&rsquo;un vieux mot de passe soit pas sécurisé, soit que vous n&rsquo;arrivez pas à retenir :</p>
<p><strong>Générer la clé : 10 secondes</strong><br />
<code>$ ssh-keygen -t rsa<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/thouveni/.ssh/id_rsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/[utilisateur]/.ssh/id_rsa.<br />
Your public key has been saved in /home/[utilisateur]/.ssh/id_rsa.pub.<br />
The key fingerprint is:</code></p>
<p><strong>La &laquo;&nbsp;propager&nbsp;&raquo; : 10 secondes :</strong><br />
<code>$ cat $HOME/.ssh/id_rsa.pub | ssh [utilisateur@]machine "mkdir -p .ssh; chmod 700 .ssh; cat &gt;&gt; .ssh/authorized_keys"</code><br />
<strong><em>Note : si vous utilisez un port particulier (comme le port 42 par exemple), il faut rajouter &laquo;&nbsp;-p 42&Prime; AVANT la commande entre guillemets, et APRÈS &laquo;&nbsp;[utilisateur]@machine&nbsp;&raquo; (entre les deux)</em></strong></p>
<p><strong>Tester que ça marche : 10 secondes</strong><br />
<code>ssh [utilisateur@]machine</code></p>
<p>Enjoy <img src="//trollfactory.fr/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /> </p>
<p><span style="font-size:1.25em">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; For our English readers : &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></p>
<p>Not only it&rsquo;s more secured, but much more praticle as well, <strong>here is how to configure in 30 seconds</strong> (timer in hand !) your SSH access to your favourite server using a RSA key instead of an old-fashionned password which is either not secured either secured but impossible to remember !</p>
<p><strong>Generating the key: 10 seconds</strong><br />
<code>$ ssh-keygen -t rsa<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/[user]/.ssh/id_rsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/[user]/.ssh/id_rsa.<br />
Your public key has been saved in /home/[user]/.ssh/id_rsa.pub.<br />
The key fingerprint is:</code></p>
<p><strong>&laquo;&nbsp;Broadcasting&nbsp;&raquo; it: 10 seconds</strong><br />
<code>$ cat $HOME/.ssh/id_rsa.pub | ssh [user@]host "mkdir -p .ssh; chmod 700 .ssh; cat &gt;&gt; .ssh/authorized_keys"</code><br />
<strong><em>Note : if you use a specific port (as for instance the 42 one), you have to add &laquo;&nbsp;-p 42&Prime; BEFORE the command in quotes, and AFTER &laquo;&nbsp;[user]@host&nbsp;&raquo; (between the two)</em></strong></p>
<p><strong>Testing it works: 10 seconds</strong><br />
<code>ssh [user@]host </code></p>
<p>Enjoy <img src="//trollfactory.fr/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /> </p>
Share and Enjoy:<a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a rel="nofollow" target="_blank"  href="http://twitter.com/home?status=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key%20-%20http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;t=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&amp;source=The+Troll%26%23039%3Bs+factory+Geekeries+%26amp%3B+pens%C3%A9es&amp;summary=Non%20seulement%20c%27est%20plus%20s%C3%A9curis%C3%A9%2C%20mais%20en%20plus%20c%27est%20quand%20m%C3%AAme%20carr%C3%A9ment%20plus%20pratique%2C%20voici%20comment%20configurer%20en%2030%20secondes%20%28top%20chrono%20%21%29%20votre%20acc%C3%A8s%20SSH%20sur%20votre%20serveur%20favoris%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20plut%C3%B4t%20avec%20qu%27un%20vieux%20mot%20de%20p" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow" target="_blank"  href="http://trollfactory.fr/feed" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a rel="nofollow" target="_blank"  href="http://www.wikio.fr/vote?url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio FR" alt="Wikio FR" /></a><a rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&amp;bodytext=Non%20seulement%20c%27est%20plus%20s%C3%A9curis%C3%A9%2C%20mais%20en%20plus%20c%27est%20quand%20m%C3%AAme%20carr%C3%A9ment%20plus%20pratique%2C%20voici%20comment%20configurer%20en%2030%20secondes%20%28top%20chrono%20%21%29%20votre%20acc%C3%A8s%20SSH%20sur%20votre%20serveur%20favoris%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20plut%C3%B4t%20avec%20qu%27un%20vieux%20mot%20de%20p" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&amp;notes=Non%20seulement%20c%27est%20plus%20s%C3%A9curis%C3%A9%2C%20mais%20en%20plus%20c%27est%20quand%20m%C3%AAme%20carr%C3%A9ment%20plus%20pratique%2C%20voici%20comment%20configurer%20en%2030%20secondes%20%28top%20chrono%20%21%29%20votre%20acc%C3%A8s%20SSH%20sur%20votre%20serveur%20favoris%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20plut%C3%B4t%20avec%20qu%27un%20vieux%20mot%20de%20p" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&amp;annotation=Non%20seulement%20c%27est%20plus%20s%C3%A9curis%C3%A9%2C%20mais%20en%20plus%20c%27est%20quand%20m%C3%AAme%20carr%C3%A9ment%20plus%20pratique%2C%20voici%20comment%20configurer%20en%2030%20secondes%20%28top%20chrono%20%21%29%20votre%20acc%C3%A8s%20SSH%20sur%20votre%20serveur%20favoris%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20plut%C3%B4t%20avec%20qu%27un%20vieux%20mot%20de%20p" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a rel="nofollow" target="_blank"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/sphinn.png" class="sociable-img sociable-hovers" title="Sphinn" alt="Sphinn" /></a><a rel="nofollow" target="_blank"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/mixx.png" class="sociable-img sociable-hovers" title="Mixx" alt="Mixx" /></a><a rel="nofollow" target="_blank" title="Add to favorites" href="#" onclick="AddToFavorites(); return false;"><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/addtofavorites.png" class="sociable-img sociable-hovers" title="Add to favorites" alt="Add to favorites" /></a><a rel="nofollow" target="_blank"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/live.png" class="sociable-img sociable-hovers" title="Live" alt="Live" /></a><a rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a rel="nofollow" target="_blank"  href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/scoopeo.png" class="sociable-img sociable-hovers" title="Scoopeo" alt="Scoopeo" /></a><a rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&urllanguage=fr" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a rel="nofollow" target="_blank"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/identica.png" class="sociable-img sociable-hovers" title="Identi.ca" alt="Identi.ca" /></a><a rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;t=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;title=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Ftrollfactory.fr%2Fsidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382&amp;submitHeadline=S%27identifier%20en%20SSH%20sans%20mot%20de%20passe%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20--%20SSHA%20Authentication%20without%20password%20using%20a%20RSA%20key&amp;submitSummary=Non%20seulement%20c%27est%20plus%20s%C3%A9curis%C3%A9%2C%20mais%20en%20plus%20c%27est%20quand%20m%C3%AAme%20carr%C3%A9ment%20plus%20pratique%2C%20voici%20comment%20configurer%20en%2030%20secondes%20%28top%20chrono%20%21%29%20votre%20acc%C3%A8s%20SSH%20sur%20votre%20serveur%20favoris%20%C3%A0%20l%27aide%20d%27une%20cl%C3%A9%20RSA%20plut%C3%B4t%20avec%20qu%27un%20vieux%20mot%20de%20p&amp;submitCategory=science&amp;submitAssetType=text" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://trollfactory.fr/sidentifier-en-ssh-sans-mot-de-passe-a-laide-dune-cle-rsa-ssha-authentication-without-password-using-a-rsa-key-382/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmark Dédibox V3 chez Online.net</title>
		<link>http://trollfactory.fr/benchmark-dedibox-v3-chez-online-net-333</link>
		<comments>http://trollfactory.fr/benchmark-dedibox-v3-chez-online-net-333#comments</comments>
		<pubDate>Sun, 26 Dec 2010 19:12:47 +0000</pubDate>
		<dc:creator><![CDATA[Troll]]></dc:creator>
				<category><![CDATA[Administration serveur]]></category>
		<category><![CDATA[Geekeries]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dédibox]]></category>
		<category><![CDATA[dédibox V3]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[online.net]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[V3]]></category>

		<guid isPermaLink="false">http://trollfactory.fr/?p=333</guid>
		<description><![CDATA[Bon, en pleine installation serveur, je prends quand même le temps de faire quelques Benchmarks, et je me dis que ça en intéressera sûrement certains d&#8217;avoir les résultats (surtout ceux qui hésitent à choisir l&#8217;offre ). La dédibox V3 est fraichement installée, rien ne tourne dessus, aucun paquet supplémentaire si ce n&#8217;est le logiciel hardinfo [...]]]></description>
				<content:encoded><![CDATA[<p>Bon, en pleine installation serveur, je prends quand même le temps de faire quelques Benchmarks, et je me dis que ça en intéressera sûrement certains d&rsquo;avoir les résultats (surtout ceux qui hésitent à choisir l&rsquo;offre <img src="//trollfactory.fr/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> ).</p>
<p>La dédibox V3 est fraichement installée, rien ne tourne dessus, aucun paquet supplémentaire si ce n&rsquo;est le logiciel hardinfo et ses dépendances pour le benchmark.</p>
<p>Tout d&rsquo;abord, hdparm (débits disque) :</p>
<p><code>*:~# free -m<br />
             total       used       free     shared    buffers     cached<br />
Mem:          1980        228       1751          0         87         85<br />
-/+ buffers/cache:         55       1924<br />
Swap:         2047          0       2047<br />
*:~# hdparm -t /dev/sda</p>
<p>/dev/sda:<br />
 Timing buffered disk reads:  238 MB in  3.01 seconds =  79.01 MB/sec<br />
*:~# hdparm -T /dev/sda</p>
<p>/dev/sda:<br />
 Timing cached reads:   1374 MB in  2.00 seconds = 686.92 MB/sec<br />
*:~# hdparm -t /dev/sda</p>
<p>/dev/sda:<br />
 Timing buffered disk reads:  242 MB in  3.02 seconds =  80.21 MB/sec<br />
*:~# hdparm -T /dev/sda</p>
<p>/dev/sda:<br />
 Timing cached reads:   1358 MB in  2.00 seconds = 679.22 MB/sec<br />
</code></p>
<p>Espace disque et utilisation RAM à vide :</p>
<p>(j&rsquo;ai choisir une partition de 2G de swap au lieu de 1G proposé par défaut)</p>
<p><code>Sys. de fich.         Tail. Occ. Disp. %Occ. Monté sur<br />
/dev/sda2             145G  1,8G  136G   2% /<br />
tmpfs                 991M     0  991M   0% /lib/init/rw<br />
proc                     0     0     0   -  /proc<br />
sysfs                    0     0     0   -  /sys<br />
procbususb               0     0     0   -  /proc/bus/usb<br />
udev                   10M  480K  9,6M   5% /dev<br />
tmpfs                 991M     0  991M   0% /dev/shm<br />
devpts                   0     0     0   -  /dev/pts<br />
/dev/sda1             190M   26M  155M  14% /boot</code></p>
<p>Maintenant, le bench HardInfo :</p>
<p><code>hardinfo<br />
Computer<br />
 Summary<br />
 Operating System<br />
 Kernel Modules<br />
 Boots<br />
 Languages<br />
 Filesystems<br />
 Shared Directories<br />
 Display<br />
 Network Interfaces<br />
 Users<br />
Devices<br />
 Processor<br />
 Memory<br />
 PCI Devices<br />
 USB Devices<br />
 Printers<br />
 Battery<br />
 Sensors<br />
 Input Devices<br />
 Storage<br />
Benchmarks<br />
 CPU ZLib</p>
<p>*** Warning: Cannot load ZLib: /usr/lib/libz.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou répertoire de ce type</p>
<p> CPU Fibonacci<br />
 CPU MD5<br />
 CPU SHA1<br />
 CPU Blowfish<br />
 FPU Raytracing</p>
<p>Computer<br />
********</p>
<p>Summary<br />
-------</p>
<p>-Computer-<br />
Processor               : VIA Nano processor U2250 (1.6GHz Capable)<br />
Memory          : 2028MB (70MB used)<br />
Operating System                : Debian GNU/Linux 5.0.4<br />
User Name               : root (root)<br />
Date/Time               : lun 27 déc 2010 04:22:39 CET<br />
-Display-<br />
Resolution              : 0x0 pixels<br />
OpenGL Renderer         : Unknown<br />
X11 Vendor              : (null)<br />
-Multimedia-<br />
Audio Adapter           : (null)<br />
-Input Devices-<br />
 Macintosh mouse button emulation<br />
 PC Speaker<br />
 Sleep Button<br />
 Power Button<br />
 Power Button<br />
-Printers-<br />
No printers found<br />
-IDE Disks-</p>
<p>Operating System<br />
----------------</p>
<p>-Version-<br />
Kernel          : Linux 2.6.32-bpo.5-amd64 (x86_64)<br />
Compiled                : #1 SMP Mon Dec 13 17:10:39 UTC 2010<br />
C Library               : GNU C Library version 2.7 (stable)<br />
Distribution            : Debian GNU/Linux 5.0.4<br />
-Current Session-<br />
Computer Name           : nttserv<br />
User Name               : root (root)<br />
Home Directory          : /root<br />
Desktop Environment             : Terminal<br />
-Misc-<br />
Uptime          : 24 minutes<br />
Load Average            : 0,00, 0,00, 0,00</p>
<p>Kernel Modules<br />
--------------</p>
<p>-Loaded Modules-<br />
evdev           : Input driver event char devices<br />
dcdbas          : Dell Systems Management Base Driver (version 5.6.0-3.2)<br />
i2c_viapro              : vt82c596 SMBus driver<br />
snd_pcm         : Midlevel PCM code for ALSA.<br />
psmouse         : PS/2 mouse driver<br />
snd_timer               : ALSA timer interface<br />
button          : ACPI Button Driver<br />
processor               : ACPI Processor Driver<br />
shpchp          : Standard Hot Plug PCI Controller Driver<br />
serio_raw               : Raw serio driver<br />
i2c_core                : I2C-Bus main module<br />
snd             : Advanced Linux Sound Architecture driver for soundcards.<br />
pci_hotplug             : PCI Hot Plug PCI Core<br />
soundcore               : Core sound module<br />
snd_page_alloc          : Memory allocator for ALSA system.<br />
pcspkr          : PC Speaker beeper driver<br />
ext3            : Second Extended Filesystem with journaling extensions<br />
jbd<br />
mbcache         : Meta block cache (for extended attributes)<br />
raid10<br />
raid456<br />
async_raid6_recov               : asynchronous RAID-6 recovery api<br />
async_pq                : asynchronous raid6 syndrome generation/validation<br />
raid6_pq<br />
async_xor               : asynchronous xor/xor-zero-sum api<br />
xor<br />
async_memcpy            : asynchronous memcpy api<br />
async_tx                : Asynchronous Bulk Memory Transactions API<br />
raid1<br />
raid0<br />
multipath<br />
linear<br />
md_mod<br />
sd_mod          : SCSI disk (sd) driver<br />
crc_t10dif              : T10 DIF CRC calculation<br />
ata_generic             : low-level driver for generic ATA<br />
pata_via                : low-level driver for VIA PATA<br />
ehci_hcd                : USB 2.0 &amp;apos;Enhanced&amp;apos; Host Controller (EHCI) Driver<br />
uhci_hcd                : USB Universal Host Controller Interface driver<br />
libata          : Library module for ATA devices<br />
usbcore<br />
nls_base<br />
scsi_mod                : SCSI core<br />
e1000e          : Intel(R) PRO/1000 Network Driver<br />
thermal         : ACPI Thermal Zone Driver<br />
fan             : ACPI Fan Driver<br />
thermal_sys             : Generic thermal management sysfs support</p>
<p>Boots<br />
-----</p>
<p>-Boots-<br />
Mon Dec 27 03:58 - 04:22 (00:24)                : Kernel 2.6.32-bpo.5-amd<br />
Mon Dec 27 03:53 - 03:56 (00:02)                : Kernel 2.6.32-bpo.5-amd<br />
Mon Dec 27 03:04 - 03:56 (00:52)                : Kernel 2.6.32-bpo.5-amd</p>
<p>Languages<br />
---------</p>
<p>-Available Languages-<br />
français                : French locale for France<br />
french          : French locale for France<br />
fr_FR           : French locale for France<br />
fr_FR@euro              : French locale for France with Euro<br />
fr_FR.iso88591          : French locale for France<br />
fr_FR.iso885915         : French locale for France with Euro</p>
<p>Filesystems<br />
-----------</p>
<p>-Mounted File Systems-<br />
/dev/sda2               : 144,5 GiB total, 136,3 GiB free<br />
tmpfs           : 990,3 MiB total, 990,3 MiB free<br />
proc            : 0,0 B total, 0,0 B free<br />
sysfs           : 0,0 B total, 0,0 B free<br />
procbususb              : 0,0 B total, 0,0 B free<br />
udev            : 10,0 MiB total, 9,5 MiB free<br />
tmpfs           : 990,3 MiB total, 990,3 MiB free<br />
devpts          : 0,0 B total, 0,0 B free<br />
/dev/sda1               : 189,9 MiB total, 155,0 MiB free</p>
<p>Shared Directories<br />
------------------</p>
<p>-SAMBA-<br />
Cannot open /etc/samba/smb.conf<br />
-NFS-</p>
<p>Display<br />
-------</p>
<p>-Display-<br />
Resolution              : 0x0 pixels<br />
Vendor          : (null)<br />
Version         : (null)<br />
-Monitors-<br />
-Extensions-</p>
<p>Network Interfaces<br />
------------------</p>
<p>-Network Interfaces-<br />
lo              : Sent 0,13MiB, received 0,13MiB (127.0.0.1)<br />
eth0            : Sent 3,72MiB, received 21,99MiB (88.191.132.66)<br />
eth1            : Sent 0,00MiB, received 0,00MiB</p>
<p>Users<br />
-----</p>
<p>-Human Users-<br />
pcinfoweb<br />
-System Users-<br />
root            : root<br />
daemon          : daemon<br />
bin             : bin<br />
sys             : sys<br />
sync            : sync<br />
games           : games<br />
man             : man<br />
lp              : lp<br />
mail            : mail<br />
news            : news<br />
uucp            : uucp<br />
proxy           : proxy<br />
www-data                : www-data<br />
backup          : backup<br />
list            : Mailing List Manager<br />
irc             : ircd<br />
gnats           : Gnats Bug-Reporting System (admin)<br />
nobody          : nobody<br />
libuuid<br />
Debian-exim<br />
statd<br />
bind<br />
ntpd<br />
sshd</p>
<p>Devices<br />
*******</p>
<p>Processor<br />
---------</p>
<p>-Processor-<br />
Name            : VIA Nano processor U2250 (1.6GHz Capable)<br />
Family, model, stepping         : 6, 15, 3 (Centaur i386 class)<br />
Vendor          : CentaurHauls<br />
-Configuration-<br />
Cache Size              : 1024kb<br />
Frequency               : 1595,00MHz<br />
BogoMIPS                : 3191,00<br />
Byte Order              : Little Endian<br />
-Features-<br />
FDIV Bug                : yes<br />
HLT Bug         : yes<br />
F00F Bug                : yes<br />
Coma Bug                : yes<br />
Has FPU         : yes<br />
-Capabilities-<br />
fpu             : Floating Point Unit<br />
vme             : Virtual 86 Mode Extension<br />
de              : Debug Extensions - I/O breakpoints<br />
pse             : Page Size Extensions (4MB pages)<br />
tsc             : Time Stamp Counter and RDTSC instruction<br />
msr             : Model Specific Registers<br />
pae             : Physical Address Extensions<br />
mce             : Machine Check Architeture<br />
cx8             : CMPXCHG8 instruction<br />
apic            : Advanced Programmable Interrupt Controller<br />
sep             : Fast System Call (SYSENTER/SYSEXIT)<br />
mtrr            : Memory Type Range Registers<br />
pge             : Page Global Enable<br />
mca             : Machine Check Architecture<br />
cmov            : Conditional Move instruction<br />
pat             : Page Attribute Table<br />
clflush         : Cache Line Flush instruction<br />
acpi            : Thermal Monitor and Software Controlled Clock<br />
mmx             : MMX technology<br />
fxsr            : FXSAVE and FXRSTOR instructions<br />
sse             : SSE instructions<br />
sse2            : SSE2 (WNI) instructions<br />
ss              : Self Snoop<br />
tm              : Thermal Monitor<br />
pbe             : Pending Break Enable<br />
syscall         : SYSCALL and SYSEXIT instructions<br />
nx              : No-execute Page Protection<br />
lm<br />
constant_tsc<br />
up<br />
rep_good<br />
pni<br />
monitor<br />
vmx<br />
est<br />
tm2<br />
ssse3<br />
cx16<br />
xtpr<br />
rng<br />
rng_en<br />
ace<br />
ace_en<br />
ace2<br />
phe<br />
phe_en<br />
lahf_lm</p>
<p>Memory<br />
------</p>
<p>-Memory-<br />
Total Memory            : 2028088 kB<br />
Free Memory             : 1786444 kB<br />
Buffers         : 10888 kB<br />
Cached          : 171048 kB<br />
Cached Swap             : 0 kB<br />
Active          : 139536 kB<br />
Inactive                : 67096 kB<br />
Active(anon)            : 24704 kB<br />
Inactive(anon)          : 484 kB<br />
Active(file)            : 114832 kB<br />
Inactive(file)          : 66612 kB<br />
Unevictable             : 0 kB<br />
Mlocked         : 0 kB<br />
Virtual Memory          : 2096472 kB<br />
Free Virtual Memory             : 2096472 kB<br />
Dirty           : 8 kB<br />
Writeback               : 0 kB<br />
AnonPages               : 24704 kB<br />
Mapped          : 9004 kB<br />
Shmem           : 492 kB<br />
Slab            : 19132 kB<br />
SReclaimable            : 13572 kB<br />
SUnreclaim              : 5560 kB<br />
KernelStack             : 560 kB<br />
PageTables              : 2108 kB<br />
NFS_Unstable            : 0 kB<br />
Bounce          : 0 kB<br />
WritebackTmp            : 0 kB<br />
CommitLimit             : 3110516 kB<br />
Committed_AS            : 87912 kB<br />
VmallocTotal            : 34359738367 kB<br />
VmallocUsed             : 274392 kB<br />
VmallocChunk            : 34359458584 kB<br />
HardwareCorrupted               : 0 kB<br />
HugePages_Total         : 0<br />
HugePages_Free          : 0<br />
HugePages_Rsvd          : 0<br />
HugePages_Surp          : 0<br />
Hugepagesize            : 2048 kB<br />
DirectMap4k             : 7488 kB<br />
DirectMap2M             : 2056192 kB</p>
<p>PCI Devices<br />
-----------</p>
<p>-PCI Devices-<br />
Host bridge             : VIA Technologies, Inc. VX800 Host Bridge<br />
Host bridge             : VIA Technologies, Inc. VX800/VX820 Error Reporting<br />
Host bridge             : VIA Technologies, Inc. VX800/VX820 Host Bus Control<br />
Host bridge             : VIA Technologies, Inc. VX800 PCI to PCI Bridge<br />
Host bridge             : VIA Technologies, Inc. VX800/VX820 Power Management Control<br />
PIC             : VIA Technologies, Inc. VX800/VX820 APIC and Central Traffic Control<br />
Host bridge             : VIA Technologies, Inc. VX800/VX820 Scratch Registers<br />
Host bridge             : VIA Technologies, Inc. VX800/VX820 North-South Module Interface Control<br />
VGA compatible controller               : VIA Technologies, Inc. Device 1122<br />
PCI bridge              : VIA Technologies, Inc. VX800/VX820 PCI Express Root Port<br />
PCI bridge              : VIA Technologies, Inc. VX800/VX820 PCI Express Root Port<br />
PCI bridge              : VIA Technologies, Inc. VX800/VX820 PCI Express Root Port<br />
IDE interface           : VIA Technologies, Inc. VX800 Serial ATA and EIDE Controller<br />
USB Controller          : VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller<br />
USB Controller          : VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller<br />
USB Controller          : VIA Technologies, Inc. USB 2.0<br />
ISA bridge              : VIA Technologies, Inc. VX800/VX820 Bus Control and Power Management<br />
Host bridge             : VIA Technologies, Inc. VX800/VX820 South-North Module Interface Control<br />
PCI bridge              : VIA Technologies, Inc. Device b353<br />
Ethernet controller             : Intel Corporation 82574L Gigabit Network Connection<br />
Ethernet controller             : Intel Corporation 82574L Gigabit Network Connection</p>
<p>USB Devices<br />
-----------</p>
<p>Printers<br />
--------</p>
<p>-Printers-<br />
No printers found</p>
<p>Battery<br />
-------</p>
<p>-No batteries-<br />
No batteries found on this system</p>
<p>Sensors<br />
-------</p>
<p>Input Devices<br />
-------------</p>
<p>-Input Devices-<br />
 Macintosh mouse button emulation<br />
 PC Speaker<br />
 Sleep Button<br />
 Power Button<br />
 Power Button</p>
<p>Storage<br />
-------</p>
<p>-IDE Disks-</p>
<p>Benchmarks<br />
**********</p>
<p>CPU ZLib<br />
--------</p>
<p>-CPU ZLib-<br />
<i>This Machine</i>             : 0,000<br />
PowerPC 740/750 (280.00MHz)             : 2150.597408<br />
Intel(R) Celeron(R) M processor         1.50GHz         : 8761.604561</p>
<p>CPU Fibonacci<br />
-------------</p>
<p>-CPU Fibonacci-<br />
<i>This Machine</i>             : 5,583<br />
Intel(R) Celeron(R) M processor         1.50GHz         : 8.1375674<br />
PowerPC 740/750 (280.00MHz)             : 58.07682</p>
<p>CPU MD5<br />
-------</p>
<p>-CPU MD5-<br />
<i>This Machine</i>             : 39,310<br />
PowerPC 740/750 (280.00MHz)             : 7.115258<br />
Intel(R) Celeron(R) M processor         1.50GHz         : 38.6607998</p>
<p>CPU SHA1<br />
--------</p>
<p>-CPU SHA1-<br />
<i>This Machine</i>             : 35,914<br />
PowerPC 740/750 (280.00MHz)             : 6.761451<br />
Intel(R) Celeron(R) M processor         1.50GHz         : 49.6752776</p>
<p>CPU Blowfish<br />
------------</p>
<p>-CPU Blowfish-<br />
<i>This Machine</i>             : 21,352<br />
Intel(R) Celeron(R) M processor         1.50GHz         : 26.1876862<br />
PowerPC 740/750 (280.00MHz)             : 172.816713</p>
<p>FPU Raytracing<br />
--------------</p>
<p>-FPU Raytracing-<br />
<i>This Machine</i>             : 19,973<br />
Intel(R) Celeron(R) M processor         1.50GHz         : 40.8816714<br />
PowerPC 740/750 (280.00MHz)             : 161.312647</code></p>
<p>Voilà, bonne soirée <img src="//trollfactory.fr/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> </p>
Share and Enjoy:<a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net%20-%20http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;t=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&amp;source=The+Troll%26%23039%3Bs+factory+Geekeries+%26amp%3B+pens%C3%A9es&amp;summary=Bon%2C%20en%20pleine%20installation%20serveur%2C%20je%20prends%20quand%20m%C3%AAme%20le%20temps%20de%20faire%20quelques%20Benchmarks%2C%20et%20je%20me%20dis%20que%20%C3%A7a%20en%20int%C3%A9ressera%20s%C3%BBrement%20certains%20d%27avoir%20les%20r%C3%A9sultats%20%28surtout%20ceux%20qui%20h%C3%A9sitent%20%C3%A0%20choisir%20l%27offre%20%3A%29%20%29.%0D%0A%0D%0ALa%20d%C3%A9dibox%20V3%20es" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow" target="_blank"  href="http://trollfactory.fr/feed" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a rel="nofollow" target="_blank"  href="http://www.wikio.fr/vote?url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio FR" alt="Wikio FR" /></a><a rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&amp;bodytext=Bon%2C%20en%20pleine%20installation%20serveur%2C%20je%20prends%20quand%20m%C3%AAme%20le%20temps%20de%20faire%20quelques%20Benchmarks%2C%20et%20je%20me%20dis%20que%20%C3%A7a%20en%20int%C3%A9ressera%20s%C3%BBrement%20certains%20d%27avoir%20les%20r%C3%A9sultats%20%28surtout%20ceux%20qui%20h%C3%A9sitent%20%C3%A0%20choisir%20l%27offre%20%3A%29%20%29.%0D%0A%0D%0ALa%20d%C3%A9dibox%20V3%20es" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&amp;notes=Bon%2C%20en%20pleine%20installation%20serveur%2C%20je%20prends%20quand%20m%C3%AAme%20le%20temps%20de%20faire%20quelques%20Benchmarks%2C%20et%20je%20me%20dis%20que%20%C3%A7a%20en%20int%C3%A9ressera%20s%C3%BBrement%20certains%20d%27avoir%20les%20r%C3%A9sultats%20%28surtout%20ceux%20qui%20h%C3%A9sitent%20%C3%A0%20choisir%20l%27offre%20%3A%29%20%29.%0D%0A%0D%0ALa%20d%C3%A9dibox%20V3%20es" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&amp;annotation=Bon%2C%20en%20pleine%20installation%20serveur%2C%20je%20prends%20quand%20m%C3%AAme%20le%20temps%20de%20faire%20quelques%20Benchmarks%2C%20et%20je%20me%20dis%20que%20%C3%A7a%20en%20int%C3%A9ressera%20s%C3%BBrement%20certains%20d%27avoir%20les%20r%C3%A9sultats%20%28surtout%20ceux%20qui%20h%C3%A9sitent%20%C3%A0%20choisir%20l%27offre%20%3A%29%20%29.%0D%0A%0D%0ALa%20d%C3%A9dibox%20V3%20es" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a rel="nofollow" target="_blank"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/sphinn.png" class="sociable-img sociable-hovers" title="Sphinn" alt="Sphinn" /></a><a rel="nofollow" target="_blank"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/mixx.png" class="sociable-img sociable-hovers" title="Mixx" alt="Mixx" /></a><a rel="nofollow" target="_blank" title="Add to favorites" href="#" onclick="AddToFavorites(); return false;"><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/addtofavorites.png" class="sociable-img sociable-hovers" title="Add to favorites" alt="Add to favorites" /></a><a rel="nofollow" target="_blank"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/live.png" class="sociable-img sociable-hovers" title="Live" alt="Live" /></a><a rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a rel="nofollow" target="_blank"  href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/scoopeo.png" class="sociable-img sociable-hovers" title="Scoopeo" alt="Scoopeo" /></a><a rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&urllanguage=fr" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a rel="nofollow" target="_blank"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/identica.png" class="sociable-img sociable-hovers" title="Identi.ca" alt="Identi.ca" /></a><a rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;t=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;title=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Ftrollfactory.fr%2Fbenchmark-dedibox-v3-chez-online-net-333&amp;submitHeadline=Benchmark%20D%C3%A9dibox%20V3%20chez%20Online.net&amp;submitSummary=Bon%2C%20en%20pleine%20installation%20serveur%2C%20je%20prends%20quand%20m%C3%AAme%20le%20temps%20de%20faire%20quelques%20Benchmarks%2C%20et%20je%20me%20dis%20que%20%C3%A7a%20en%20int%C3%A9ressera%20s%C3%BBrement%20certains%20d%27avoir%20les%20r%C3%A9sultats%20%28surtout%20ceux%20qui%20h%C3%A9sitent%20%C3%A0%20choisir%20l%27offre%20%3A%29%20%29.%0D%0A%0D%0ALa%20d%C3%A9dibox%20V3%20es&amp;submitCategory=science&amp;submitAssetType=text" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://trollfactory.fr/benchmark-dedibox-v3-chez-online-net-333/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Les tâches planifiées sous Linux (cron, crontab) : seconde approche</title>
		<link>http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139</link>
		<comments>http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#comments</comments>
		<pubDate>Sat, 13 Feb 2010 07:00:11 +0000</pubDate>
		<dc:creator><![CDATA[Troll]]></dc:creator>
				<category><![CDATA[Administration serveur]]></category>
		<category><![CDATA[Scripts, astuces, dév. web]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[automatisation]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[tâches planifiées]]></category>

		<guid isPermaLink="false">http://trollfactory.fr/?p=139</guid>
		<description><![CDATA[Bonsoir la compagnie, Après avoir fait joujou une première fois avec les tâches planifiées sous cron gnu/linux, je vous avais promis de vous en dire plus sur les procédés et les possibilités du système de planification des tâches de GNU/Linux : cron. Résumé de ce que vous savez déjà faire si vous avez lu la [...]]]></description>
				<content:encoded><![CDATA[<p>Bonsoir la compagnie,</p>
<p>Après avoir fait joujou une première fois avec <strong><a title="Lire l'article sur une première approche des tâches planifiées sous Linux" href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" target="_blank">les tâches planifiées sous cron gnu/linux</a></strong>, je vous avais promis de vous en dire plus sur les procédés et les possibilités du système de <strong>planification des tâches de GNU/Linux : cron</strong>.</p>
<p>Résumé de ce que vous savez déjà faire si vous avez lu <a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" target="_blank">la première partie sur les tâches planifiées cron</a> :</p>
<ul>
<li>Créer une <strong>tâche planifiée</strong> simple qui lance un fichier <strong>exécutable</strong> avec l&rsquo;utilisateur courant (celui qui a créé le cron) à l&rsquo;aide<strong> la commande crontab</strong></li>
<li>Faire des tâches planifiées à exécution unique (planification non régulière/récurrente)</li>
<li>(Utiliser un autre éditeur pour la commande crontab -e)</li>
</ul>
<p>Ce que je vais vous apprendre en plus dans cet article :</p>
<ul>
<li>Gérer des dates complexes : Répétitions, récurrence des <strong>tâches planifiées</strong> (<strong>jokers, répétitions, sélections multiples</strong>)</li>
<li>Définition d&rsquo;un <strong>fichier personnalisé</strong> de tâches planifiées</li>
<li>Définir une tâche exécutée par un <strong>utilisateur précis.</strong></li>
<li>Éxécuter une tâche planifiée <strong>dans un répertoire particulier</strong>.</li>
<li>Éxécuter une <strong>tâche planifiée graphique.</strong></li>
<li><strong>Gérer les sorties</strong> des commandes exécutées par CRON : logs, mails, etc.</li>
</ul>
<p>Je vous donnerai également quelques filons pour l&rsquo;utilisation de <strong>PHP avec CRON</strong>.<br />
<br /><br /></p>
<h2>Retour sur la planification des tâches : la syntaxe des dates avancées avec CRON.</h2>
<p>Je ne refais pas les explications sur les dates simples dans CRON, c&rsquo;est le sujet de la première approche (dont vous avez les liens au début de cet article). Nous allons voir comment <strong>créer une tâche récurrente</strong>, à l&rsquo;aide des <strong>jokers</strong>, <strong>répétitions</strong> et<strong> sélections multiples</strong>.<br />
<br /><br /></p>
<h3>Le joker : *</h3>
<p>Comme dans beaucoup d&rsquo;applications informatique, le joker chez Cron est l&rsquo;étoile &laquo;&nbsp;*&nbsp;&raquo;. Ainsi, si vous remplacez un quelconque paramètre d&rsquo;une date par une étoile, cela signifie pour cron &laquo;&nbsp;quelque-soit la valeur de ce paramètre&nbsp;&raquo;.</p>
<p>Exemple : Quelque-soit le jour, je veux que à 7h05 tu dises bonjour, durant tout le mois de février :</p>
<p><code>05 07 * 02 * echo 'Hello World !'</code></p>
<p>Ici <strong>nous avons remplacé le numéro du jour dans le mois, ainsi que le jour de la semaine</strong> (qui est également susceptible de varier !) <strong>par le joker &laquo;&nbsp;*&nbsp;&raquo;</strong>, ainsi, quelque-soit les valeurs de ces paramètres, si les autres paramètres (heure, minute, mois) sont vérifiés, CRON dira bonjour au monde.<br />
<br /><br /></p>
<h3>La répétition : /</h3>
<p>Le joker permet de spécifier, au maximum, une répétition toutes les <strong>unités de temps</strong> d&rsquo;un paramètre précis. En effet, si je mets un joker pour l&rsquo;heure, alors cela sera exécuté toutes les <strong>une</strong> heure, puisque cela sera &laquo;&nbsp;quelque-soit l&rsquo;heure&nbsp;&raquo;. Ainsi, avec les jokers, vous pouvez répéter au mieux : tous les jours, toutes les heures, toutes les minutes, tous les lundis, tous les mois&#8230; Bref, pas terrible comme flexibilité tout de même. C&rsquo;est à cela que sert la répétition, elle vous permet de dire tous les combien de variation d&rsquo;un paramètre vous voulez que cela se répète. Une variation d&rsquo;un paramètre, c&rsquo;est +1 minutes, +1 heure, +1 jour, etc. &#8230;</p>
<p>L&rsquo;opérateur de répétition s&rsquo;utilise comme suit : valeur_param<span style="color: #ff0000;"><strong>/</strong></span>intervalle_de_repetition</p>
<p>Ainsi, si je veux que toutes les 15 minutes, une action se répète, quelque-soit la date :</p>
<p><code>*/15 * * * * /usr/bin/monaction</code></p>
<p>On utilise ici également le joker, puisque l&rsquo;action se répète quelque-soit la minute, l&rsquo;heure, ou la date&#8230;</p>
<p><br /><br /><br />
<h3>Les intervalles et les sélections multiples</h3>
<p>Vous pouvez également définir <strong>plusieurs valeurs d&rsquo;un paramètre</strong> pour lesquelles la tâche sera exécutée. On procède soit en donnant <strong>un intervalle de valeurs</strong>, soit une <strong>liste de valeurs</strong>.</p>
<p><strong>Opérateur d&rsquo;intervalle : -</strong></p>
<p>Utilisation : borne1-borne2 ou borne1 et borne2 sont les bornes de l&rsquo;intervalle ( [borne1 ; borne2] ) et incluses.</p>
<p>Exemple : La précédente action se répète toutes les 15 minutes, du 1er au 10 du mois</p>
<p><code>*/15 * 1-10 * * /usr/bin/monaction</code></p>
<p><strong>Opérateur de valeurs multiples : ,</strong></p>
<p>Utilisation : valeur1, valeur2, valeur3&#8230;</p>
<p>Exemple : La précédente action se répète toutes les 15 minutes mais seulement entre 02h et 03h puis entre 05h et 06h</p>
<p><code>*/15 2,5 * * * /usr/bin/monaction</code></p>
<p><br /><br /></p>
<h2>Définir une fichier cron personnalisé : Cron en mode admin</h2>
<p>Jusqu&rsquo;à présent, vous avez utilisé la commande <em><strong>crontab</strong></em> afin de modifier votre fichier cron et d&rsquo;ajouter ou de supprimer des tâches.</p>
<p>En réalité vous n&rsquo;avez utilisé que le côté &laquo;&nbsp;<em>utilisateur</em>&nbsp;&raquo; de cron. La suite n&rsquo;est ouverte qu&rsquo;à un accès root, autrement dit l&rsquo;administateur de la machine, car elle permet notamment de décider de sous quel utilisateur vont être exécutées les tâches, ce que nous verrons en même temps.</p>
<p>Si ce mode d&rsquo;utilisation de cron n&rsquo;est réservé qu&rsquo;à l&rsquo;<strong>administateur</strong>, c&rsquo;est pour plusieurs raisons :</p>
<ol>
<li>Il va permettre, comme je l&rsquo;ai dit, de choisir l&rsquo;utilisateur qui exécute la commande</li>
<li>Le répertoire dans lequel nous allons créer le fichier appartient à root</li>
<li>Seul root peut demander à cron de recharger les fichiers de configuration, or nous en aurons besoin car comme nous allons éditer de simples fichiers, la commande <em>crontab</em> ne sera pas là pour, à la fin de l&rsquo;édition du fichier, dire à cron <em>&laquo;&nbsp;Hey hey, ouhou, on a modifié le fichier là, viens y jeter un coup d&rsquo;oeil&nbsp;&raquo;</em> et par défaut <strong>cron ne verra donc pas vos modifs sans reload</strong>, et donc sans droits d&rsquo;admin.</li>
</ol>
<p><br /><br /><br />
<h3>Créer votre fichier de tâches planifiées : le répertoire /etc/cron.d/</h3>
<p>Vous êtes donc maintenant loggé en root, ou, si vous n&rsquo;avez pas le <em><strong>su</strong></em> sur votre machine, vous exécuterez le reste des commandes avec un &laquo;&nbsp;sudo&nbsp;&raquo; devant.</p>
<p>Les fichiers de tâches planifiées sont placés dans le répertoire <strong>/etc/cron.d/</strong>, qui appartient à root.</p>
<p>Créons-y un fichier :</p>
<p><code>vim /etc/cron.d/monfichiercron</code></p>
<p>Voilà, tout le travail est fait&#8230; ou presque. Dans ce fichier, vous pouvez placer des tâches planifiées <strong>exactement de la même façon qu&rsquo;avec la commande crontab</strong> à la différence prêt&#8230; qu&rsquo;il faut spécifier l&rsquo;utilisateur d&rsquo;exécution !</p>
<p>Cela donne :</p>
<p><code>mm HH JJ MM joursemaine utilisateur /chemin/commande</code></p>
<p>Exemple, je suis l&rsquo;utilisateur Troll, je veux que l&rsquo;utilisateur Toto fasse le ménage dans son dossier personnel chaque semaine (vision geek du <em>Range ta chambre !</em> maternel/paternel), on dira qu&rsquo;on est un peu radical, si le dimanche il n&rsquo;a pas vidé son dossier perso (il est censé le faire le samedi) tant pis : tout poubelle !<br />
<em>Note : A NE PAS TESTER CHEZ VOUS ! Vous risqueriez d&rsquo;avoir de sérieux ennui ^^</em></p>
<p><code>01 00 * * sun toto rm -fR /home/toto/*</code></p>
<p>Bien sûr l&rsquo;utilisateur peut aussi être <em>root</em>&#8230; But, be careful !</p>
<p>Ensuite, une fois que vous avez sauvegardé votre fichier, il faut dire à cron de le relire pour l&rsquo;intégrer :</p>
<p>(encore une commande à faire en root, si vous avez bien lu le début de ce paragraphe !)<br />
<code>/etc/init.d/crond reload</code></p>
<p>Cron a bien rechargé s&rsquo;il dit ça normalement :</p>
<p><code>Reloading crond:                                           [  OK  ]</code></p>
<p><br /><br /><br />
<h3>Les autres fichiers préconfigurés de cron :</h3>
<p>Cron a également <strong>des dossiers préconfigurés</strong>, dans lesquels il vous suffit de mettre <strong>un script</strong> (ou un lien symbolique, solution la plus souvent utilisée) <strong>exécutable</strong>.</p>
<p>Ces dossiers sont les suivants :</p>
<ul>
<li><strong>/</strong><strong>etc/crond.daily</strong> : exécution quotidienne (chaque jour à 4h02)</li>
<li><strong>/etc/crond.hourly</strong> : exécution chaque heure (chaque heure + 1 minute)</li>
<li><strong>/etc/crond.weekly</strong> : exécution hebdomadaire (le dimanche à 4h22)</li>
<li><strong>/etc/crond.monthly</strong> : exécution mensuelle (le 1er du mois à 4h42)</li>
</ul>
<p>Comme je suis gentil, je vous donne même les commandes :</p>
<p><strong>Création d&rsquo;un script exécutable dans un dossier :</strong><br />
(en root encore et toujours)<br />
<code>vim /mon/chemin/de/fichier &amp;amp;&amp;amp; chmod +x /mon/chemin/de/fichier</code></p>
<p><strong>Création d&rsquo;un lien symbolique</strong> dans /etc/crond.daily (par exemple) pointant vers /mon/chemin/de/fichier :</p>
<p><code>ln -s /mon/chemin/de/fichier /etc/crond.daily/monscript &amp;amp;&amp;amp; chmod +x /etc/crond.daily/monscript</code></p>
<p>L&rsquo;avantage du lien symbolique c&rsquo;est que vous pouvez mettre votre script dans un dossier où vous le retrouvez et vous pouvez placer un lien dans plusieurs dossiers /etc/crond.XXX/ <strong>sans avoir à modifier tous les fichiers quand vous modifiez le script</strong> (principe du lien symbolique).</p>
<p><br /><br /><br />
<h2>Éxécuter des tâches planifiées dans un répertoire particlier</h2>
<p>Il peut s&rsquo;avérer que vous ayiez besoin d&rsquo;exécuter une commande qui va chercher des fichiers ou autres dans son répertoire courant et qui sera donc perdue si vous la lancez avec cron de la manière <em>/chemin/commande</em></p>
<p>Pour cela, utilisez tout simplement la commande <strong>cd</strong> :</p>
<p><code>03 01 * * * tutu cd /home/tutu/scripts/ &amp;amp;&amp;amp; ./macommande</code></p>
<p><br /><br /><br />
<h2>Éxécution d&rsquo;une tâche planifiée graphique</h2>
<p>La console, y&rsquo;a rien de mieux, ça plante pas, ça vous cache rien&#8230; Mais c&rsquo;est pas très esthétique. Puis si vous voulez par exemple lancer Amarok pour vous reveiller en musique, Amarok va avoir besoin d&rsquo;une interface graphique (sauf si vous connaissez une interface ligne de commande pour amarok, auquel cas je veux bien que vous partagiez l&rsquo;info avec moi !).</p>
<p>Pour cela, procédez comme suit : placez <strong>DISPLAY=:0</strong> après le jour de la semaine, ou après le nom d&rsquo;utilisateur quand celui-ci est spécifié.</p>
<p>Si vous utilisez une commande composée, du type :</p>
<p><code>/chemin/premierecommande &amp;amp;&amp;amp; /chemin/deuxiemecommande</code></p>
<p>(ce qui est notamment le cas lorsque vous exécutez dans un répertoire particulier) alors vous devez mettre le <strong>DISPLAY=:0</strong> juste avant la commande qui aura besoin de l&rsquo;affichage.</p>
<h2>Gérer les sorties des commandes exécutées par CRON : logs, mails, etc.</h2>
<p>Par défaut, notamment lors de la définition d&rsquo;une tâche planifiée avec <strong>crontab -e</strong>, si votre commande génère une <em>sortie</em> vous devez &#8211; en théorie (désactivé sur certaines distrib&rsquo;) &#8211; recevoir un &laquo;&nbsp;mail&nbsp;&raquo; ( dans /var/spool/votrelogin ) avec la sortie générée.</p>
<p>Ce n&rsquo;est pas vraiment un mode très pratique pour logger et retrouver les sorties de vos tâches planifiées préférées.</p>
<p>Je vais donc vous montrer comment enregistrer dans un fichier log la sortie de vos tâches planifiées.</p>
<p>En fait, cela revient au même que pour enregistrer dans un fichier log une commande console standard. Cela revient à faire comme ceci :</p>
<p><strong>Enregistrer tout</strong> dans monfichier.log (sortie normale + erreurs)<br />
<code>/chemin/macomandequigenereunesortie &amp;gt; monfichier.log 2&amp;gt;&amp;amp;1</code></p>
<p><strong>Enregistrer seulement les erreurs</strong> dans monfichier.log :</p>
<p><code>/chemin/macomandequigenereunesortie &amp;gt; /dev/null 2&amp;gt; monfichier.log</code></p>
<p><strong>Ne rien enregistrer</strong> :</p>
<p><code>/chemin/macomandequigenereunesortie &amp;gt; /dev/null 2&amp;gt;&amp;amp;1</code></p>
<p><strong>Attention, tel que c&rsquo;est présenté ici, chaque nouvelle exécution remplace le contenu de monfichier.log</strong></p>
<p>Si vous voulez logger sur plus d&rsquo;un seul lancement, vous devez créer le fichier monfichier.log avant (ce qui n&rsquo;était pas nécessaire précédemment) et remplacer systématiquement dans les précédentes commandes, le &laquo;&nbsp;&gt;&nbsp;&raquo; par &laquo;&nbsp;&gt;&gt;&nbsp;&raquo; (enfin presque, pas tous, regardez ci-dessous).</p>
<p>Ce qui donne :</p>
<p><code>/chemin/macomandequigenereunesortie &amp;gt;&amp;gt; monfichier.log 2&amp;gt;&amp;amp;1</code><br />
<code>/chemin/macomandequigenereunesortie &amp;gt; /dev/null 2&amp;gt;&amp;gt; monfichier.log</code><br />
<code>/chemin/macomandequigenereunesortie &amp;gt; /dev/null 2&amp;gt;&amp;amp;1</code><br />
<br /><br /></p>
<h2>Annexes : Utilisation de PHP avec CRON</h2>
<p>Pour lancer une <strong>tâche écrite en PHP avec cron</strong>, saisissez une tâche de la manière suivante :</p>
<p><code>mm HH JJ MM joursemaine [user] /usr/bin/php -f /chemin/de/fichier.php</code></p>
<p>Ou, ce qui est conseillé avec PHP, avec exécution dans un repértoire particulier :</p>
<p><code>mm HH JJ MM joursemaine [user] cd /chemin/de/ &amp;amp;&amp;amp; /usr/bin/php -f ./fichier.php</code></p>
<p>Bien évidemment, vous pouvez logger dans un .log avec les .php comme avec n&rsquo;importe quelle autre commande.</p>
<p>Voilà, c&rsquo;est terminé : des remarques, des erreurs à signaler, des questions -&gt; Les commentaires sont là pour ça ! J&rsquo;espère avoir été clair et que cet article sera utile au plus grand nombre <img src="//trollfactory.fr/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley" /></p>
Share and Enjoy:<a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche%20-%20http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;t=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&amp;source=The+Troll%26%23039%3Bs+factory+Geekeries+%26amp%3B+pens%C3%A9es&amp;summary=Bonsoir%20la%20compagnie%2C%0D%0A%0D%0AApr%C3%A8s%20avoir%20fait%20joujou%20une%20premi%C3%A8re%20fois%20avec%20les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20cron%20gnu%2Flinux%2C%20je%20vous%20avais%20promis%20de%20vous%20en%20dire%20plus%20sur%20les%20proc%C3%A9d%C3%A9s%20et%20les%20possibilit%C3%A9s%20du%20syst%C3%A8me%20de%20planification%20des%20t%C3%A2ches%20de%20GNU%2FL" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow" target="_blank"  href="http://trollfactory.fr/feed" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a rel="nofollow" target="_blank"  href="http://www.wikio.fr/vote?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio FR" alt="Wikio FR" /></a><a rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&amp;bodytext=Bonsoir%20la%20compagnie%2C%0D%0A%0D%0AApr%C3%A8s%20avoir%20fait%20joujou%20une%20premi%C3%A8re%20fois%20avec%20les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20cron%20gnu%2Flinux%2C%20je%20vous%20avais%20promis%20de%20vous%20en%20dire%20plus%20sur%20les%20proc%C3%A9d%C3%A9s%20et%20les%20possibilit%C3%A9s%20du%20syst%C3%A8me%20de%20planification%20des%20t%C3%A2ches%20de%20GNU%2FL" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&amp;notes=Bonsoir%20la%20compagnie%2C%0D%0A%0D%0AApr%C3%A8s%20avoir%20fait%20joujou%20une%20premi%C3%A8re%20fois%20avec%20les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20cron%20gnu%2Flinux%2C%20je%20vous%20avais%20promis%20de%20vous%20en%20dire%20plus%20sur%20les%20proc%C3%A9d%C3%A9s%20et%20les%20possibilit%C3%A9s%20du%20syst%C3%A8me%20de%20planification%20des%20t%C3%A2ches%20de%20GNU%2FL" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&amp;annotation=Bonsoir%20la%20compagnie%2C%0D%0A%0D%0AApr%C3%A8s%20avoir%20fait%20joujou%20une%20premi%C3%A8re%20fois%20avec%20les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20cron%20gnu%2Flinux%2C%20je%20vous%20avais%20promis%20de%20vous%20en%20dire%20plus%20sur%20les%20proc%C3%A9d%C3%A9s%20et%20les%20possibilit%C3%A9s%20du%20syst%C3%A8me%20de%20planification%20des%20t%C3%A2ches%20de%20GNU%2FL" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a rel="nofollow" target="_blank"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/sphinn.png" class="sociable-img sociable-hovers" title="Sphinn" alt="Sphinn" /></a><a rel="nofollow" target="_blank"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/mixx.png" class="sociable-img sociable-hovers" title="Mixx" alt="Mixx" /></a><a rel="nofollow" target="_blank" title="Add to favorites" href="#" onclick="AddToFavorites(); return false;"><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/addtofavorites.png" class="sociable-img sociable-hovers" title="Add to favorites" alt="Add to favorites" /></a><a rel="nofollow" target="_blank"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/live.png" class="sociable-img sociable-hovers" title="Live" alt="Live" /></a><a rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a rel="nofollow" target="_blank"  href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/scoopeo.png" class="sociable-img sociable-hovers" title="Scoopeo" alt="Scoopeo" /></a><a rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&urllanguage=fr" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a rel="nofollow" target="_blank"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/identica.png" class="sociable-img sociable-hovers" title="Identi.ca" alt="Identi.ca" /></a><a rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;t=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139&amp;submitHeadline=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20seconde%20approche&amp;submitSummary=Bonsoir%20la%20compagnie%2C%0D%0A%0D%0AApr%C3%A8s%20avoir%20fait%20joujou%20une%20premi%C3%A8re%20fois%20avec%20les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20cron%20gnu%2Flinux%2C%20je%20vous%20avais%20promis%20de%20vous%20en%20dire%20plus%20sur%20les%20proc%C3%A9d%C3%A9s%20et%20les%20possibilit%C3%A9s%20du%20syst%C3%A8me%20de%20planification%20des%20t%C3%A2ches%20de%20GNU%2FL&amp;submitCategory=science&amp;submitAssetType=text" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Les tâches planifiées sous Linux (cron, crontab) : première approche</title>
		<link>http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75</link>
		<comments>http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75#comments</comments>
		<pubDate>Thu, 24 Dec 2009 06:40:59 +0000</pubDate>
		<dc:creator><![CDATA[Troll]]></dc:creator>
				<category><![CDATA[Administration serveur]]></category>
		<category><![CDATA[Geekeries]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[automatisation]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[tâches planifiées]]></category>

		<guid isPermaLink="false">http://trollfactory.fr/?p=75</guid>
		<description><![CDATA[Mise à jour : La deuxième partie de ce guide sur les tâches planifiées, intitulée Tâches planifiées sous Linux (cron, crontab) : Seconde approche est dorénavant disponible ici : Tâches planifiées sous Linux (cron, crontab) : Seconde approche. Article original : Salut la compagnie, Aujourd&#8217;hui, et malgré les touffes de poils que le Troll s&#8217;est [...]]]></description>
				<content:encoded><![CDATA[<p><em><strong>Mise à jour :</strong> La deuxième partie de ce guide sur les tâches planifiées, intitulée <a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post" target="_blank">Tâches planifiées sous Linux (cron, crontab) : Seconde approche</a> est dorénavant disponible ici : <em><a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post" target="_blank">Tâches planifiées sous Linux (cron, crontab) : Seconde approche</a></em>.</em></p>
<p><a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post"> </a><em>Article original : </em><br />
Salut la compagnie,</p>
<p>Aujourd&rsquo;hui, et malgré les touffes de poils que le Troll s&rsquo;est arrachées toute la journée en se battant avec le fameux vilain <strong>cron </strong>et son accolite <strong>crontab</strong>, je vais vous parler de quelque-chose de bien utile, voire tout simplement indispensable, pour n&rsquo;importe quel administrateur d&rsquo;un serveur web, ou même d&rsquo;un site internet (mais il est assez rare que vous ayiez la possibilité de mettre des cron sans avoir un dédié (ou au moins un VPS) ) : <strong>les tâches planifiées</strong>.</p>
<p>Les tâches planifiées c&rsquo;est quoi ? Que vous soyiez GNU/Linuxien ou Windowsien (bouuuuuuh, bon ok, j&rsquo;arrête) vous ne le savez peut-être pas mais votre système est capable de faire des choses sans que vous lui demandiez, sans que vous n&rsquo;ayiez quoi que ce soit à faire, de manière automatique.</p>
<p><a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post"> </a>Cela s&rsquo;appelle <strong>les tâches planifiées </strong>, concrètement cela signifie qu&rsquo;une <em>tâche</em>, va être <em>planifiée</em> (jusque-là, vous suivez ?), et qu&rsquo;une fois que c&rsquo;est fait, elle s&rsquo;exécutera de manière automatique soit une fois, soit plusieurs fois, suivant la manière dont on la planifie.</p>
<p><a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post"> </a></p>
<h2>Planifier ? Késako ?</h2>
<p>Tout d&rsquo;abord, considérons que vous n&rsquo;avez jamais eu à faire à ce genre de choses, et partons du début : Planifier ? Késako ? (si vous n&rsquo;avez jamais vu ce mot&#8230; euh&#8230; je plains votre patron)  Planifier, cela signifie que l&rsquo;on va fixer une date, une heure, un moment précis, où l&rsquo;on souhaite exécuter une tâche.</p>
<p><a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post"> </a><strong>Si c&rsquo;est une tâche </strong><em><strong>unique</strong></em>, que l&rsquo;on a besoin d&rsquo;effectué qu&rsquo;une seule fois, parce-qu&rsquo;on est pas là à ce moment-là par exemple (comment que vous programmiez votre magnétoscope pour enregistrer le film débile du samedi soir (pour vos enfants bien sûr&#8230; vous, vous ne regardez rien de stupide, Arte©® Powered, n&rsquo;est-ce pas ?) ).</p>
<p><a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post"> </a></p>
<p><strong>Si c&rsquo;est une tâche <em>récurrente</em></strong> c&rsquo;est-à-dire qu&rsquo;il faudra l&rsquo;exécuter régulièrement (comme faire le ménage !), dans ce cas il sera possible de la programmer de manière à ce qu&rsquo;elle s&rsquo;effectue de manière <em>récurrente</em>, toujours au même moment, à la même heure, etc. &#8230; (et de la même façon, on a à faire à des ordinateurs standards, pas d&rsquo;<a href="http://fr.wikipedia.org/wiki/IA" target="_blank">IA</a> encore).</p>
<h2>Cron &amp; Crontab : Je planifie, tu planifies&#8230;</h2>
<p><strong>Sous Linux, le principal outil de planification se nomme cron</strong>, et très vite nous (et vous aussi) appelerons tout simplement une <em>tâche planifiée</em> un <em>cron</em>.</p>
<p>Tout d&rsquo;abord, avez-vous cron d&rsquo;installé ?  Cron est installé sur un bon 80% des distributions, donc il y a des chances. Pour le savoir tapez :</p>
<p><code> ls -l /etc/init.d/ | grep cron </code></p>
<p><em> Pour ceux sous archlinux, /etc/init.d c&rsquo;est /etc/rc.d/ de mémoire. </em></p>
<p>Si vous êtes sous un système basé sur debian, avec aptitude :</p>
<p><code> sudo aptitude show cron </code></p>
<p>Sous Fedora :</p>
<p><code>sudo yum install cron</code></p>
<p>(si cron est déjà installé ça vous le dira, sinon, ça l&rsquo;installera !!)</p>
<p>Comme on est pas encore sûr que cron soit déjà lancé, faisons un petit restart :</p>
<p><code> sudo /etc/init.d/cron restart </code></p>
<p><em> (il est possible que le fichier soit nommé &laquo;&nbsp;crond&nbsp;&raquo; chez vous)</em></p>
<p><strong> Bon, on est prêt, cron est lancé. </strong> Maintenant que faire ?</p>
<p>Dans cette première partie, comme c&rsquo;est écrit dans le titre, je ne vais pas vous donner toutes les &laquo;&nbsp;clés&nbsp;&raquo; de cron, nous allons simplement voir ensemble comment utiliser la commande de base, qui permet en fait à elle seule de tout faire, juste d&rsquo;un manière <strong>parfois</strong> moins &laquo;&nbsp;propre&nbsp;&raquo; qu&rsquo;en passant par certains fichiers un peu plus &laquo;&nbsp;complexes&nbsp;&raquo; (pas vraiment complexes en fait, mais ça vous fais manipuler des fichiers etc. etc. &#8230; puis faut être root, alors ne commençons par les bêtises tout de suite).</p>
<p><strong> La commande dont vous allez dorénavant tomber amoureux est la suivante :</strong></p>
<p><code>crontab -e</code></p>
<p>La commande <strong>crontab</strong> permet, de manière générale, de mettre à jour et modifier les tâches <em>cron</em> d&rsquo;un utilisateur donné.</p>
<p>Donnons tout de même quelques <strong>précisions </strong>dessus :</p>
<p>- Si vous voulez <strong>remplacer la totalité de votre crontab</strong> (c&rsquo;est-à-dire toutes les tâches qu&rsquo;il contient, comme nous allons le voir après) par le contenu d&rsquo;un fichier, utilisez la commande comme ceci :</p>
<p><code>crontab /chemin/vers/mon/fichier</code></p>
<p>- Ensuite, par défaut la commande <strong>crontab </strong>va éditer le fichier crontab de <em>l&rsquo;utilisateur courant</em> (oui, c&rsquo;est vous qui courez),  si vous voulez modifier le crontab d&rsquo;un autre utilisateur (notamment pratique quand on exécute la commande en root !!)  il faut lui préciser <strong>le paramètre &laquo;&nbsp;-u&nbsp;&raquo; </strong>comme ceci :</p>
<p><code>crontab -u user</code></p>
<p>- Et puis allez, un petit dernier pour la route, pour <strong>voir le contenu de votre crontab sans l&rsquo;éditer</strong> (le &laquo;&nbsp;-e&nbsp;&raquo; que nous allons voir) :</p>
<p><code>crontab -l</code></p>
<p>Les paramètres peuvent bien entendus se <strong>combiner </strong>:</p>
<p><code>crontab -l -u troll</code></p>
<p>(affiche le contenu du crontab de l&rsquo;utilisateur <em>troll</em> (c&rsquo;est moi) )</p>
<p>Voilà, maintenant passons aux choses sérieuses, donc, <strong>l&rsquo;édition</strong> :</p>
<p><code>crontab -e</code></p>
<p>Vous voilà maintenant dans un fichier texte, ne vous souciez pas de savoir où il est ni ce que c&rsquo;est, car c&rsquo;est en réalité un fichier temporaire.</p>
<p>Vous êtes certainement (95% de chance) sous l&rsquo;éditeur en console &laquo;&nbsp;<strong>Nano</strong>&laquo;&nbsp;,  si vous savez utiliser vim (ou vi pour les courageux) et que vous êtes (comme moi) allergiques à nano, je vous file quand même la magouille :</p>
<p><code>EDITOR="vim" crontab -e</code></p>
<p>Je me contenterai pour ma part de décrire les actions à faire sous nano, supposant que si vous utilisez vim, c&rsquo;est que vous savez vous en servir (vraiment trèèèès compliqué&#8230; (ironie) ).</p>
<p><strong>Dans ce fichier, vous mettrez une tâche planifiée par ligne</strong>, et UNE SEULE !</p>
<p>Suivant la longueur de votre &laquo;&nbsp;ligne&nbsp;&raquo; cell-ci peut s&rsquo;afficher sur plusieurs &laquo;&nbsp;lignes&nbsp;&raquo; en console, mais tant que vous n&rsquo;avez pas mis de retour ligne (Entrée) cela reste la même ligne. L<strong>orsque qu&rsquo;une ligne est trop longue pour être affichée en plein, nano la coupe en général et met un &laquo;&nbsp;$&nbsp;&raquo; à la fin</strong> pour vous dire que tout n&rsquo;est pas affiché.</p>
<p>Maintenant voyons <strong>la syntaxe</strong> des &laquo;&nbsp;<em>cron&nbsp;&raquo;</em> :  ceux-ci sont constitués de <strong>deux parties distinctes : le moment d&rsquo;exécution, et la commande à exécuter (ou tâche)</strong>. Les deux parties sont séparées par un espace (comme souvent sous GNU/Linux).</p>
<p>Ce qui donnera donc à la fin :</p>
<p><code>partie_date partie_tache</code></p>
<p>Voyons ce qu&rsquo;on met à la place de <strong>partie_date</strong> (dans l&rsquo;ordre, avec un espace entre chaque donnée à chaque fois) :</p>
<ol>
<li><strong>minute</strong> : la minute (00 à 60) de l&rsquo;heure à laquelle exécuter la tâche</li>
<li><strong>heure</strong> : l&rsquo;heure (0 à 23), de l&rsquo;heure de planification de la tâche</li>
<li><strong>jour du mois</strong> : de 0 à 31 (ou autre, suivant les mois), le jour, dans la date de planification de la tâche</li>
<li><strong>mois</strong> : nombre correspondant au mois (00 à 12) de la date à laquelle vous voulez planifier.</li>
<li><strong>jour de la semaine</strong> : Le nom abrégé (mon, tue, wed, thu, fri, sat, sun) ou le numéro (1 à 7) du jour de la date de planification au sein de sa semaine : Lundi = 1, mardi = 2, etc&#8230;</li>
</ol>
<p>Voilà, petit exemple, admettons que je veuille exécuter une date le 1er de l&rsquo;an 2010 à une heure de l&rsquo;après-midi, la partie &laquo;&nbsp;partie_date&nbsp;&raquo; sera la suivante :</p>
<p><code>00 13 01 01 fri</code></p>
<p><strong>Vous devez avoir au total 5 données</strong> : minute heure jourdumois mois jourdelasemaine  Voilà, pour la partie &laquo;&nbsp;date&nbsp;&raquo;, nous nous contenterons des dates fixes dans cette première approches.</p>
<p><strong>Venons-en à la tâche à éxécuter</strong> : Ici, rien de plus compliqué que de taper dans une console. Cron lira la tâche à exécuter avec <em>bash</em>, ce qui signifie qu&rsquo;il le lira de la même manière (enfin presque) qu&rsquo;il lit les choses quand vous, vous tapez dans la console.</p>
<p>Un petit détail cependant : <strong>mettez toujours toutes les commandes en chemin ABSOLU ! ! !</strong> Même les commandes qui paraissent évidentes et qui sont dans /usr/sbin, rajoutez bien le /chemin/vers/mon/fichier . <img src="//trollfactory.fr/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /></p>
<p>Ce qui vous donnera, une fois les deux <em>parties</em> remplies :</p>
<p><code>minute jour jourdumois mois jourdelasemaine /chemin/vers/ma/commande</code></p>
<p><strong>Maintenant que vous avez écrit votre tâche planifiée, il n&rsquo;y a plus qu&rsquo;à enregistrer et fermer !</strong></p>
<p>Pour ça, faites <strong>CTRL + X</strong>, puis appuyez sur &laquo;&nbsp;<strong>O</strong>&nbsp;&raquo; pour répondre oui à la question, et enfin appuyez sur <strong>ENTREE </strong>pour confirmer votre &laquo;&nbsp;oui&nbsp;&raquo;.</p>
<p><em>S</em><em>ous vi/vim : sortez du mode édition (<strong>CTRL + C</strong>) puis tapez le traditionnel <strong>:wq</strong></em></p>
<p>Voilà, je vous écris très prochainement la partie suivante : seconde approche.</p>
<p>On y abordera : les jokers, les répétitions, les sélections multiples dans les dates.</p>
<p>Dans les tâches : comment gérer leur sortie et enregistrer leurs résultats et leurs erreurs, ou au contraire ne pas le faire, et ne pas recevoir de &laquo;&nbsp;mail&nbsp;&raquo; du logger. On parlera peut-être également de la modification manuelle des fichiers cron auxquels la commande &laquo;&nbsp;crontab&nbsp;&raquo; ne touche pas.  Petite note : si vous avez un quelconque problème avec ces explications, laissez un comm&rsquo; pour demander de l&rsquo;aide <img src="//trollfactory.fr/wp-includes/images/smilies/icon_wink.gif" alt=";-)" class="wp-smiley" /></p>
<p><strong>Mise à jour : La deuxième partie de ce guide sur les tâches planifiées, intitulée <a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post" target="_blank">Tâches planifiées sous Linux (cron, crontab) : Seconde approche</a> est dorénavant disponible ici : <a href="http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-seconde-approche-139#post">tâches planifiées sous Linux (cron, crontab) : Gestion et commandes avancées</a>.</strong></p>
Share and Enjoy:<a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/printfriendly.png" class="sociable-img sociable-hovers" title="Print" alt="Print" /></a><a rel="nofollow" target="_blank"  href="http://www.printfriendly.com/print/new?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/pdf.png" class="sociable-img sociable-hovers" title="PDF" alt="PDF" /></a><a rel="nofollow" target="_blank"  href="http://twitter.com/home?status=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche%20-%20http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a><a rel="nofollow" target="_blank"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;t=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a><a rel="nofollow" target="_blank"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&amp;source=The+Troll%26%23039%3Bs+factory+Geekeries+%26amp%3B+pens%C3%A9es&amp;summary=Mise%20%C3%A0%20jour%20%3A%20La%20deuxi%C3%A8me%20partie%20de%20ce%20guide%20sur%20les%20t%C3%A2ches%20planifi%C3%A9es%2C%20intitul%C3%A9e%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approche%20est%20dor%C3%A9navant%20disponible%20ici%20%3A%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approch" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/linkedin.png" class="sociable-img sociable-hovers" title="LinkedIn" alt="LinkedIn" /></a><a rel="nofollow" target="_blank"  href="http://trollfactory.fr/feed" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/rss.png" class="sociable-img sociable-hovers" title="RSS" alt="RSS" /></a><a rel="nofollow" target="_blank"  href="http://www.wikio.fr/vote?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/wikio.png" class="sociable-img sociable-hovers" title="Wikio FR" alt="Wikio FR" /></a><a rel="nofollow" target="_blank"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&amp;bodytext=Mise%20%C3%A0%20jour%20%3A%20La%20deuxi%C3%A8me%20partie%20de%20ce%20guide%20sur%20les%20t%C3%A2ches%20planifi%C3%A9es%2C%20intitul%C3%A9e%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approche%20est%20dor%C3%A9navant%20disponible%20ici%20%3A%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approch" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a><a rel="nofollow" target="_blank"  href="http://delicious.com/post?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&amp;notes=Mise%20%C3%A0%20jour%20%3A%20La%20deuxi%C3%A8me%20partie%20de%20ce%20guide%20sur%20les%20t%C3%A2ches%20planifi%C3%A9es%2C%20intitul%C3%A9e%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approche%20est%20dor%C3%A9navant%20disponible%20ici%20%3A%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approch" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a><a rel="nofollow" target="_blank"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&amp;annotation=Mise%20%C3%A0%20jour%20%3A%20La%20deuxi%C3%A8me%20partie%20de%20ce%20guide%20sur%20les%20t%C3%A2ches%20planifi%C3%A9es%2C%20intitul%C3%A9e%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approche%20est%20dor%C3%A9navant%20disponible%20ici%20%3A%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approch" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a><a rel="nofollow" target="_blank"  href="http://technorati.com/faves?add=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/technorati.png" class="sociable-img sociable-hovers" title="Technorati" alt="Technorati" /></a><a rel="nofollow" target="_blank"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/sphinn.png" class="sociable-img sociable-hovers" title="Sphinn" alt="Sphinn" /></a><a rel="nofollow" target="_blank"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/mixx.png" class="sociable-img sociable-hovers" title="Mixx" alt="Mixx" /></a><a rel="nofollow" target="_blank" title="Add to favorites" href="#" onclick="AddToFavorites(); return false;"><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/addtofavorites.png" class="sociable-img sociable-hovers" title="Add to favorites" alt="Add to favorites" /></a><a rel="nofollow" target="_blank"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/live.png" class="sociable-img sociable-hovers" title="Live" alt="Live" /></a><a rel="nofollow" target="_blank"  href="http://www.netvibes.com/share?title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&amp;url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/netvibes.png" class="sociable-img sociable-hovers" title="Netvibes" alt="Netvibes" /></a><a rel="nofollow" target="_blank"  href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/scoopeo.png" class="sociable-img sociable-hovers" title="Scoopeo" alt="Scoopeo" /></a><a rel="nofollow" target="_blank"  href="http://www.viadeo.com/shareit/share/?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&urllanguage=fr" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/viadeo.png" class="sociable-img sociable-hovers" title="viadeo FR" alt="viadeo FR" /></a><a rel="nofollow" target="_blank"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/identica.png" class="sociable-img sociable-hovers" title="Identi.ca" alt="Identi.ca" /></a><a rel="nofollow" target="_blank"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;t=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/myspace.png" class="sociable-img sociable-hovers" title="MySpace" alt="MySpace" /></a><a rel="nofollow" target="_blank"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;title=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a><a rel="nofollow" target="_blank"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Ftrollfactory.fr%2Fles-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75&amp;submitHeadline=Les%20t%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20premi%C3%A8re%20approche&amp;submitSummary=Mise%20%C3%A0%20jour%20%3A%20La%20deuxi%C3%A8me%20partie%20de%20ce%20guide%20sur%20les%20t%C3%A2ches%20planifi%C3%A9es%2C%20intitul%C3%A9e%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approche%20est%20dor%C3%A9navant%20disponible%20ici%20%3A%20T%C3%A2ches%20planifi%C3%A9es%20sous%20Linux%20%28cron%2C%20crontab%29%20%3A%20Seconde%20approch&amp;submitCategory=science&amp;submitAssetType=text" ><img src="//trollfactory.fr/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://trollfactory.fr/les-taches-planifiees-sous-linux-cron-crontab-premiere-approche-75/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
