<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19863" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2015-01-30T11:32:35-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19863</id>

		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2015-01-30T11:32:35-04:00</updated>

		<published>2015-01-30T11:32:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103455#p103455</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103455#p103455"/>
		<title type="html"><![CDATA[crontab.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103455#p103455"><![CDATA[
Hi guys:<br><br>I've created a tcl script that will run once a day and delete log files when they are older than 30 days, instead of using crontab. If anyone would like to use it, here it is:<div class="codebox"><p>Code: </p><pre><code>foreach bind [binds logs] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}bind time - "00 00 * * *" logsproc logs {min hour day month year} {  putlog "Deleting logs"  foreach file [glob -nocomplain -directory logs *.log] {  set time [clock seconds]  set log [file mtime $file]  set diff [expr ($time - $log) / 86400]  if {$diff &gt;= 30} {putlog "Deleting $file"  file delete -force $file }}}putlog "Crontab loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Fri Jan 30, 2015 11:32 am</p><hr />
]]></content>
	</entry>
	</feed>
