You are not logged in.

#1 2008-09-13 17:57:08

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Newbie question about logrotate and "olddir" option

I have just added "olddir /var/log_archive" line to my logrotate.conf (the rest is Arch default). Should I now move manually all these *.1 *.2 *.3 *.4 files from /var/log to /var/log_archive or will logrotate do that for me? And what with the files in the subdirectories like /var/log/samba/? Should I move them to /var/log_archive/samba?

Offline

#2 2008-09-16 03:58:38

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Newbie question about logrotate and "olddir" option

I don't *know* the answer. But I bet that you have to move the files yourself. Logrotate doesn't keep track of old files. It just looks to see if they're there where it's currently configured to think they might be; if so it rotates them. So with your config changes, it will now look to see if there are existing .1 .2 etc files in /var/log_archive. (You may need to create /var/log_archive, if it's not already there. There may be a config option to make logrotate do this for you; but it's easiest to do it ahead of time and give the folder the appropriate owner/permissions.)

As to the subfolders, I suspect they will also need to be moved. In addition to the main /etc/logrotate.conf, there are also package-by-package config files in /etc/logrotate.d/. Look them over to see where the /var/log/samba {...} config block is. (And so on for all your /var/log/* subfolders.) I THINK you'll need to add an "olddir /var/log_archive/samba" command to each of those blocks; otherwise the rotated files will just be put into the top-level /var/log_archive.

This is all off the top of my head; so don't rely on it without checking against the manpage and google. But I thought it might point you in the right direction.

Offline

#3 2008-09-26 08:51:50

senjin
Member
Registered: 2006-09-15
Posts: 181
Website

Re: Newbie question about logrotate and "olddir" option

I copied the files manually and it seems to work properly. Thanks!

Offline

Board footer

Powered by FluxBB