Dear All,
These lines would help you to truncate a file in the
/var/log directory using syslogd and logrotate
I am using the maillog file as the example. Please add the following lines in
/etc/logrotate/syslog
/var/log/maillog {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
}
You can call the command /usr/sbin/logrotate -f /etc/logrotate.d/syslog to
invoke it at the time you want or please make it as a cron job.
Thanks
K.Deepak
"Anthony E. Greene" wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 24-Jun-2002/10:44 +0800, Mohammed Maeraj Hasbi <[EMAIL PROTECTED]> wrote:
> >Maybe this is quite a dumb question,
> >in my system, i have this one file which size is over 200Mb. How can I
> >truncate the file to 50k? is there any command that I can use to do this?
>
> After you truncate the file, if it's a log file, you should setup
> logrotate and enable the "compress" option in /etc/logrotate.conf.
>
> Tony
> - --
> Anthony E. Greene <mailto:[EMAIL PROTECTED]>
> OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
> AOL/Yahoo Chat: TonyG05 HomePage: <http://www.pobox.com/~agreene/>
> Linux. The choice of a GNU generation <http://www.linux.org/>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: Anthony E. Greene <mailto:[EMAIL PROTECTED]> 0x6C94239D
>
> iD8DBQE9Ft84pCpg3WyUI50RAuMbAKC410KPQIUyOC0r1cldxKZXpp6XPgCeKGqz
> j7rVC0Q0blio+bdRu2Z9KwI=
> =G6OZ
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list