On 7/25/19 4:54 PM, Ken Moffat via blfs-support wrote:
On Thu, Jul 25, 2019 at 04:34:45PM -0400, Baho Utot via blfs-support wrote:
Well how does one lose control over log rotation by using cron.daily?

You assume that rotating logs daily is a good idea.  On my (home)
server I run a weekly script from my crontab, and keep several weeks
of gzipped logs.  On desktops I use a different script, but again
'weekly' (the desktops are not running permanently, and might be
booting different systems when I do experimental builds, or when I
update older systems, so 'weekly' is whenever fcron decides to run
it ;-)


Then don't install logrotate!

On desktops properly configure logrotate to give you what you wish.



Anyway, as long as your method works for you (e.g. it doesn't keep
writing to the old log after the rotation, and you keep as many old
versions as you desire, then all is good.  In BLFS, one size does
not fit everyone.

well doesn't the book have logrotate in it and the logs are rotated every day at 3:00am,

so my way the logs are rotated at 4:02am.  So it doesn't change anything other than you

don't have to play fiddle with fcrontab

BTW the logs are not rotated every day  by default,

cat > /etc/logrotate.conf << EOF
# Begin of /etc/logrotate.conf

# Rotate log files weekly
weekly

# Don't mail logs to anybody
nomail

# If the log file is empty, it will not be rotated
notifempty

# Number of backups that will be kept
# This will keep the 2 newest backups only
rotate 2

# Create new empty files after rotating old ones
# This will create empty log files, with owner
# set to root, group set to sys, and permissions 644
create 0664 root sys

# Compress the backups with gzip
compress

# No packages own lastlog or wtmp -- rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/lastlog {
    monthly
    rotate 1
}

I missed the daily part :(


-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to