<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=344256&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / Ecriture dans fichier log [RESOLU]]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=344256</link>
		<description><![CDATA[Les sujets les plus récents dans Ecriture dans fichier log [RESOLU].]]></description>
		<lastBuildDate>Fri, 18 Sep 2009 08:49:34 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2930697#p2930697</link>
			<description><![CDATA[<p>Ok, merci Dominique. Je penche sur la question. <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>Bonne Ubuntu à tous !</p>]]></description>
			<author><![CDATA[dummy@example.com (Elève linuxien)]]></author>
			<pubDate>Fri, 18 Sep 2009 08:49:34 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2930697#p2930697</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2930615#p2930615</link>
			<description><![CDATA[<p>C&#039;est logrotate qui fait ca tres bien : il garde le nombre d&#039;historiques demandes, les compacte si necessaire, relance les services si ils le faut...</p><p>il est lance tous les jours par cron. Si tu cree un nouveau fichier de log, cree aussi la configuration pour logrotate.</p>]]></description>
			<author><![CDATA[dummy@example.com (dominique.fournier)]]></author>
			<pubDate>Fri, 18 Sep 2009 07:34:39 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2930615#p2930615</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929567#p2929567</link>
			<description><![CDATA[<p>FRUiT : Merci de ta réponse, mais là on écrase systématiquement le précédent et de ce fait je n&#039;aurai aucune visibilité même pas à deux jours.</p>]]></description>
			<author><![CDATA[dummy@example.com (Elève linuxien)]]></author>
			<pubDate>Thu, 17 Sep 2009 13:52:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929567#p2929567</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929564#p2929564</link>
			<description><![CDATA[<div class="codebox"><pre><code>echo &quot;=================================&quot;  &gt; /root/cron_log_rm_www.log</code></pre></div><p>En utilisant cette première ligne d&#039;écriture dans le fichier, le contenu sera remplacé à chaque lancement du script. Après pour compter le nombre d&#039;exécutions je laisse répondre des experts <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (FRUiT)]]></author>
			<pubDate>Thu, 17 Sep 2009 13:48:08 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929564#p2929564</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929521#p2929521</link>
			<description><![CDATA[<p>Ah si, j&#039;en profite pour vous demandez si il y a une possibilité de nettoyer le contenu du fichier log ?<br />Je m&#039;explique, le fichier est alimenté tous les jours et je n&#039;ai pas besoin de connaitre ce qui s&#039;est passé il y a trois ans... Donc je voudrais supprimer les inscriptions qui date de plus de 100 jours par exemple.</p><p>si vous avez une piste à me donner, je suis preneur.</p><p>Merci encore à vous.</p>]]></description>
			<author><![CDATA[dummy@example.com (Elève linuxien)]]></author>
			<pubDate>Thu, 17 Sep 2009 13:18:30 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929521#p2929521</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929465#p2929465</link>
			<description><![CDATA[<p>Alors, c&#039;était l&#039;option -print qu&#039;il me manquait :</p><div class="codebox"><pre><code>#!/bin/bash
echo &quot;=================================&quot;  &gt;&gt; /root/cron_log_rm_www.log
date &gt;&gt; /root/cron_log_rm_www.log
find /var/www/dossier1/* -depth -type d -a -mtime +7 -exec rm -r {} \; -print &gt;&gt; /root/cron_log_rm_www.log
echo &quot;=================================&quot; &gt;&gt; /root/cron_log_rm_www.log</code></pre></div><p>Et là il m&#039;inscrit le chemin du dossier effacer, exemple avec /var/www/dossier1/toto, le fichier log est le suivant :</p><div class="quotebox"><blockquote><div><p>=================================<br />Jeudi 17 Septembre 2009, 10:52:32&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;(UTC +0200)<br />/var/www/dossier1/toto<br />=================================</p></div></blockquote></div><p>Merci à Totor et Dominique.fournier</p><p>Bon Ubuntu à tous. <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Elève linuxien)]]></author>
			<pubDate>Thu, 17 Sep 2009 12:25:22 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929465#p2929465</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929309#p2929309</link>
			<description><![CDATA[<p>il faut préciser à find d&#039;afficher les dossiers supprimer :</p><div class="codebox"><pre><code>#!/bin/bash
exec &gt;&gt; /root/cron_log_rm_www.log
echo &quot;=================================&quot;
date
find /var/www/dossier1/ -mindepth 1 -type d -delete -print
find /var/www/dossier2/ -mindepth 1 -type d -delete -print
find /var/www/dossier3/ -mindepth 1 -type d -delete -print
find /var/www/dossier4/ -mindepth 1 -type d -delete -print
echo &quot;=================================&quot;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Totor)]]></author>
			<pubDate>Thu, 17 Sep 2009 10:16:21 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929309#p2929309</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929300#p2929300</link>
			<description><![CDATA[<p>find est silencieux par defaut.<br />Je propose :<br />find&#160; /var/www/dossier1/* -depth -type d -a -mtime +7 -ls -delete &gt;&gt; /root/cron_log_rm_www.log</p><p>De plus tu pourrais optimiser tes flux en mettant entre parentheses et en renvoyant le flux uniquement de la parenthese</p>]]></description>
			<author><![CDATA[dummy@example.com (dominique.fournier)]]></author>
			<pubDate>Thu, 17 Sep 2009 10:11:42 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929300#p2929300</guid>
		</item>
		<item>
			<title><![CDATA[Ecriture dans fichier log [RESOLU]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929296#p2929296</link>
			<description><![CDATA[<p>Bonjour,</p><p>Voilà, j&#039;ai créé un fichier qui s&quot;execute depuis un cron. Ce fichier est là pour supprimé des dossier de plus de sept jours. Je voudrais que les dossiers supprimé soient précisés repris dans un fichier de log.</p><p>Voici le code :</p><div class="codebox"><pre><code>#!/bin/bash
echo &quot;=================================&quot;  &gt;&gt; /root/cron_log_rm_www.log
date &gt;&gt; /root/cron_log_rm_www.log
find /var/www/dossier1/* -depth -type d -a -mtime +7 -exec rm -r {} \; &gt;&gt; /root/cron_log_rm_www.log

find /var/www/dossier2/* -depth -type d -a -mtime +7 -exec rm -r {} \; &gt;&gt; /root/cron_log_rm_www.log

find /var/www/dossier3/* -depth -type d -a -mtime +7 -exec rm -r {} \;&gt;&gt; /root/cron_log_rm_www.log

find /var/www/dossier4/* -depth -type d -a -mtime +7 -exec rm -r {} \; &gt;&gt; /root/cron_log_rm_www.log

find /var/www/dossier5/* -depth -type d -a -mtime +7 -exec rm -r {} \; &gt;&gt; /root/cron_log_rm_www.log
echo &quot;=================================&quot;  &gt;&gt; /root/cron_log_rm_www.log</code></pre></div><p>Le problème c&#039;est que dans le fichier log n&#039;apparait que la date :</p><div class="quotebox"><blockquote><div><p>=================================<br />Jeudi 17 Septembre 2009, 10:52:32&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;(UTC +0200)<br />=================================</p></div></blockquote></div><p>Je ne vois pas où se trouve mon erreur.</p><p>Merci d&#039;avance pour votre aide.:rolleyes:</p>]]></description>
			<author><![CDATA[dummy@example.com (Elève linuxien)]]></author>
			<pubDate>Thu, 17 Sep 2009 10:08:39 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=2929296#p2929296</guid>
		</item>
	</channel>
</rss>
