log files rotation

Robin Robin
Tue Sep 24 16:48:06 BST 2002

Hi all,

has anyone got an example shell script used to rotate the log files in

I've got this far:-


  cd /usr/local/apache_log_backup
  mv logs-s-1.tgz logs-s-2.tgz
  mv logs-s-0.tgz logs-s-1.tgz
  mv logs-s.tgz logs-s-0.tgz
  tar -c -v -z -f logs-s.tgz /usr/home/logs/

but what do you do about deleting the existing logs, or can you just delete
all of the 'logs' contents and they get re-created?

thanks in advance!

Robin Garbutt
Portfolio Art & Design Ltd
Tel -  +44 (0) 1204 383822
Fax - +44 (0) 1204 383866
Mob - +44 (0) 7811 185490
e-mail - Rob at portfoliodesign.net

For further information please visit us at :-

The contents of this e-mail are confidential to the ordinary user of the
e-mail address to which it was addressed and may also be privileged. If you
are not the addressee of this e-mail you may not copy, forward, disclose or
otherwise use it or any part of it in any form whatsoever. If you have
received this e-mail in error please e-mail the sender.

More information about the Ukfreebsd mailing list