Re: Manually rolling logfiles over

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Joseph L. Casale wrote:
> How can I do this w/o restarting services or rebooting?
>   

centos is setup using logrotate, which rotates logs according to various 
conf files (/etc/logrotate.conf has the global defaults, and 
/etc/logrotate.d/* has the app specific settings)

this is normally invoked every 24 hours from the script 
/etc/cron.daily/logrotate

most logfiles default to weekly rotation,  with 4 logfiles kept in 
rotation, unless you change the appropriate conf files...

-some- applications (postgres 8.x comes to mind) have their own log 
rotation logic and don't use this system.

if you really want to do a -manual- rotate, you'd have do something like...

cd /dir/of/logfile
rm logfile.4
mv logfile.3 logfile.4
mv logfile.2 logfile.3
mv logfile.1 logfile.2
mv logfile logfile.1
touch logfile
service whateverservice reload



(adjusting the `mv` commands to suit however many files are in rotation)

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux