List Info

Thread: Re: How to delete log files




Re: How to delete log files
country flaguser name
Australia
2007-03-02 22:51:03
David Albert wrote:

> Unfortunately, newsyslog does not do the trick.  Do you
have any other 
> ideas?

What is the contents of your /etc/newsyslog.conf ?

Also, what does "newsyslog -n" show when you run
it?

Cheers,
Simon.

Re: How to delete log files
country flaguser name
United States
2007-03-02 23:09:13
Simon Burge wrote:
> David Albert wrote:
>
>   
>> Unfortunately, newsyslog does not do the trick.  Do
you have any other 
>> ideas?
>>     
>
> What is the contents of your /etc/newsyslog.conf ?
>
> Also, what does "newsyslog -n" show when you
run it?
>
> Cheers,
> Simon.
>
>   
Everything looks good with -n, but when I actually run the
command,
it aborts with an "Operation not permitted" error.
 This is the same error
I get when I try to manually delete any file in /var/log. 
See trace below:

raq2:  newsyslog -n /var/log/maillog

/var/log/maillog <7Z>: --> trim log (log age >
interval)
  rm -f /var/log/maillog.6
  rm -f /var/log/maillog.6.gz
  mv /var/log/maillog.5.gz /var/log/maillog.6.gz
  chmod 600 /var/log/maillog.6.gz
  chown 0:0 /var/log/maillog.6.gz
  mv /var/log/maillog.4.gz /var/log/maillog.5.gz
  chmod 600 /var/log/maillog.5.gz
  chown 0:0 /var/log/maillog.5.gz
  mv /var/log/maillog.3.gz /var/log/maillog.4.gz
  chmod 600 /var/log/maillog.4.gz
  chown 0:0 /var/log/maillog.4.gz
  mv /var/log/maillog.2.gz /var/log/maillog.3.gz
  chmod 600 /var/log/maillog.3.gz
  chown 0:0 /var/log/maillog.3.gz
  mv /var/log/maillog.1.gz /var/log/maillog.2.gz
  chmod 600 /var/log/maillog.2.gz
  chown 0:0 /var/log/maillog.2.gz
  mv /var/log/maillog.0.gz /var/log/maillog.1.gz
  chmod 600 /var/log/maillog.1.gz
  chown 0:0 /var/log/maillog.1.gz
  (append rotation notice to /var/log/maillog)
  mv /var/log/maillog /var/log/maillog.0
  (create new log)
  (append rotation notice to /var/log/maillog)
  chmod 600 /var/log/maillog
  kill -HUP 222
  sleep for 10 seconds before compressing...
  gzip /var/log/maillog.0
  chown 0:0 /var/log/maillog.0.gz

raq2:  newsyslog -v /var/log/maillog

/var/log/maillog <7Z>: --> trim log (log age >
interval)
  rm -f /var/log/maillog.6
  rm -f /var/log/maillog.6.gz
  mv /var/log/maillog.5.gz /var/log/maillog.6.gz
newsyslog: /var/log/maillog.5.gz: Operation not permitted

raq2:  whoami
root
raq2:  rm -f /var/log/maillog.5.gz
rm: /var/log/maillog.5.gz: Operation not permitted

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )