From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2560e24871751973 X-Google-Attributes: gidfee84,public From: Charles M Richmond Subject: Re: syslog.dated- changing log period? Date: 1997/12/18 Message-ID: <34993FD1.832243C1@iisc.com>#1/1 X-Deja-AN: 299355545 Content-Transfer-Encoding: 7bit References: <882447391.7821.0.nnrp-03.9e982017@news.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Organization: Integrated International Systems Corp. Newsgroups: comp.unix.osf.osf1 Andrew Ireland wrote: > > Hi, > > in the /etc/syslog.conf file, entries with the /var/adm/syslog.dated/ file> have new > log directories and log files created once per day (or when syslogd is > restarted). > > Is there any way to configure syslog to create a log directory which will > log files > and create new directories say once per month? > There are two lines in the /var/spool/cron/crontabs/root entry that are pertinent to the syslogd operation. The following is the line that actually restarts the logging process. As you can see, I have chosen midnight to start my logs. If you want to only do this once a month then just change the '*' in the 3d field to be the day of the month that you wish to start your logs on. 0 0 * * * kill -1 `/bin/cat /var/run/syslog.pid` The line below here is the line that controls how often the old directories get purged. The key to this is the '-ctime' argument in the 'find' cmd. 40 4 * * * find /var/adm/syslog.dated -depth -type d -ctime +5 -exec rm -rf {} \; Charlie -- *********************************************************************** * Charles Richmond Integrated International Systems Corporation * * cmr@iisc.com cmr@koibito.iisc.com cmr@shore.net * * UNIX Internals, I18N, L10N, X, Realtime Imaging, and Custom S/W * * One Longfellow Place Suite 3309 , Boston , Ma. USA 02114-2431 * * (617) 723 7695 (617) 367 3151 FAX (617) 723 6861 * ***********************************************************************