<?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/789" />

	<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>2002-01-06T21:56:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-06T21:56:00-04:00</updated>

		<published>2002-01-06T21:56:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3550#p3550</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3550#p3550"/>
		<title type="html"><![CDATA[shell Scripting query regarding logs]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3550#p3550"><![CDATA[
i've written the following (yes it's ugly, but shell scripts ain't my best trick) script, what it does is run on a cron at 1am to gzip and move the old log leaving the current ones obviously (keep logs is on) to another directory. My main question is, can this be done any neater as i think this is rather ugly, it must run on a cron job.<br>Cheers<br><br>#!/bin/sh<br>/bin/rm -f /home/bot/temp.lst<br>/bin/rm -f /home/bot/temp2.lst<br>/bin/rm -f /home/bot/temp3.lst<br>/bin/ls -1t /home/bot/logs &gt;/home/bot/temp.lst<br>/bin/fgrep -v gz /home/bot/temp.lst &gt;/home/bot/temp2.lst<br>/usr/bin/tail --lines=+3 /home/bot/temp2.lst &gt;/home/bot/temp3.lst<br>/bin/sed -e 's/^(.*)//bin/gzip /home/bot/logs/1/' /home/bot/temp3.lst |/bin/sh<br>/bin/mv -f /home/bot/logs/*.gz /home/logs/<p>Statistics: Posted by Guest — Sun Jan 06, 2002 9:56 pm</p><hr />
]]></content>
	</entry>
	</feed>
