Mavericks log rotation

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Mavericks log rotation
# 1  
Old 05-15-2014
Mavericks log rotation

In Mavericks, Apple has apparently moved control of log rotation to ASL. There's a 'ttl' value to determine how long log files will stick around for. I can compress them, change the way they're named, limit them by size, etc. But the one thing I cannot find is how to NOT keep one log file per day... I want to be able to say this log file should rotate weekly, or monthly, or every X days.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Log rotation in PowerHA7

Hi All, I have a situation here ... HACMP is configured with application monitoring script, which is generating messages .... which is running every minute ... And every minute when monitoring script run, one one log file is generating .... and this log file is rotating ... which is rotating... (1 Reply)
Discussion started by: linux.amrit
1 Replies

2. Solaris

Log rotation

Hi All! I seem to have a problem with log rotation, unless I am doing something wrong, I have type the following command for testing purposes to see if the -s option works but he did not: logadm -w /var/adm/messages -C 8 -c -s 512k -t '/var/adm/messages.$n' -z 1 the file is now at this... (7 Replies)
Discussion started by: fretagi
7 Replies

3. UNIX for Dummies Questions & Answers

Log Rotation

Hi Guys, Good morning, I just want to know and collect ideas on this one. Regarding rotation of logs as I've observed it's not consistently functioning. I have a server with 8 Partitions, each partition has a dedicated directory for the logs that is needed and I set it every 5mins (300secs) the... (1 Reply)
Discussion started by: rymnd_12345
1 Replies

4. Solaris

Log rotation, twice

hi folk, need advise regarding the log rotation, i have the logadm set at 30 2 * * * /usr/sbin/logadm so it supposed to rotate once per day, but now it rotated twice! but someone my log will rotate at 2:30 AM, but then another 2 hours later, it creates a new and rotate a new log again,... (2 Replies)
Discussion started by: dehetoxic
2 Replies

5. Solaris

Solaris log rotation

HI, What is log rotation in Solaris ? What are the essential steps to perform log rotation in Solaris? (1 Reply)
Discussion started by: Revathi@1
1 Replies

6. Solaris

Log Rotation of Catalina.out

Hi, Recently i received a request to rotate logs of catalina.out (tomcat). The file size was about 807 MB. I used logadm to truncate the log ( -c ) and zip (-z 0) it. Everything worked fine, catalina.out.0.gz was created (22 MB) and the size of original catalina.out became 0kb. After... (2 Replies)
Discussion started by: Mack1982
2 Replies

7. Shell Programming and Scripting

log rotation and autosys

Hi, I current have many apps servers running and need to create a script to rotate logs daily, and then create an autosys job to delete logs that are older than 30 days. I was thrown into this and have no idea what to do, please help me get started, thanks! -----Post Update----- and i will... (6 Replies)
Discussion started by: new2learn09
6 Replies

8. Shell Programming and Scripting

Log rotation script

I have the below script to help with disk space cleanup that finds logs older than a specified number of days (say 10 days). I need it to grab "active" logs as well. Problem is an "active log" will not get archived unless I put in 0 days which I don't want to do, I need to leave the past 10 days,... (2 Replies)
Discussion started by: theninja
2 Replies

9. Shell Programming and Scripting

log rotation

Hello all. Due to some reason I can not use HUP to rotate needed log files. So I use the standard method: cp $file $file.1 cat /dev/null > $file But if Java application in this time writing the output to $file, in the beginning of it appears many "^@^@^@^@^@^@". How to avoid it? Or how... (6 Replies)
Discussion started by: mirusnet
6 Replies

10. HP-UX

Log rotation on HP-UX

Can anyone post a sample log rotate and archive configuration on HP-UX? I really don't know how to do that... :( (3 Replies)
Discussion started by: untamed
3 Replies
Login or Register to Ask a Question
ASLMANAGER(8)						    BSD System Manager's Manual 					     ASLMANAGER(8)

NAME
aslmanager -- Apple System Log data life-cycle manager SYNOPSIS
aslmanager [-s store_dir] [-a [archive_dir]] [-ttl days] [-store_ttl days] [-module_ttl days] [-size max_size] [-asldb] [-module [name]] [-checkpoint] [-d [level]] [-dd [level]] DESCRIPTION
aslmanager manages rotated files and ASL data written by the syslogd server. It is started automatically at various times by syslogd. It may also be invoked from the command line by the superuser (root). It manages the life-cycle of data in the ASL database, rotated log files, and ASL directory data stores. Configuration information for aslmanager comes from the /etc/asl.conf configuration file, any ASL output mod- ule configuration files in the /etc/asl directory, and from command-line options that may be specified to override some settings found in the configuration files. In normal operation, it first checks the ASL database in /var/log/asl, then it checks the files and directories speci- fied by /etc/asl.conf and each ASL output module. If the -asldb flag is specified, then only the ASL database will be processed. If the -module flag is specified, then the ASL database will not be processed. All ASL output modules, or a single module if name is speci- fied, will be processed. If -checkpoint is specified, then aslmanager will signal syslogd to checkpoint files for all modules, or for a single named module, before processing. The -d flag causes aslmanager to print debug messages tracing it's actions as they are performed. An integer value (1, 2, or 3) may follow the -d flag. Higher values cause more fine-grained messages to be printed. The default value is 1. The -dd flag directs aslmanager to do a ``dry run''. Debug messages are printed as with -d, but no actions are actually performed. An optional debug level may follow the -dd flag. ASL DATABASE MANAGEMENT aslmanager scans the ASL database in /var/log/asl, or some other path specified by the setting of the ``store_path'' parameter in asl.conf, or by the path supplied following the -s flag. Data files that are older than the time-to-live for the database are either archived or removed. Files that contain messages with explicit expire times are removed or archived monthly after all their contents expire. The default 7 day time-to-live value may be overridden by the setting of the ``store_ttl'' parameter in asl.conf or by supplying a value follow- ing the -store_ttl flag or the -ttl flag (which overrides the time-to-live for both the ASL database and for all ASL modules). A time-to- live value of zero allows files to remain in the store with no time limit. A maximum size for the entire database is provided by the setting of the ``max_store_size'' parameter in asl.conf, or as a value following the -size flag. This will cause aslmanager to archive (if enabled) and remove files to keep the database size below the specified limit. The default value is 150000000 bytes. A value of zero means the size is unlimited. An unlimited size specification should be used with great caution, since a runaway process could quickly fill all available disk space. Files are removed in order starting from oldest to new- est. Files with the same date are removed in standard lexicographic sort order by file name. Files are either removed entirely or copied to an archive directory. If the -a flag is specified with no argument, files are copied to the /var/log/asl.archive directory. An alternate directory path may be specified following the -a flag. The archive parameter setting in asl.conf enables or disables archiving. The archive parameter requires a value of "1" to enable archiving, or a value of "0" to disable it. An option archive directory path may follow the "0" or "1". ASL OUTPUT MODULE MANAGEMENT For each ASL output module, or a single module specified as an argument following -module, aslmanager first locates all checkpoint files pro- duced by syslogd for that module. aslmanager checks all ASL directory data stores and all rotated log files - those with a ``rotate'' option in the module's configuration rules. Checkpoint files are renamed if necessary to conform to the naming style specified for the file by a ``style'' option in the module's configuration file. aslmanager will compress the file if directed by a ``compress'' option, and it will move the file to a destination directory if a ``dest'' option is specified for the file. Following this, aslmanager will delete expired files. The time-to-live for files is 7 days by default, but may be specified using the ``ttl'' option for the file in the module's configu- ration rules. If -module_ttl or -ttl are specified command line, then value specified as an argument is used as a time-to-live instead. -module_ttl specifies time-to-live for module processing. -ttl specifies time-to-live for both the ASL database and for modules. Finally, if the ``all_max'' option is specified for the output file, aslmanager checks the total size of all the rotated versions, and will delete them, (oldest first) to limit the total size as specified by ``all_max''. When processing ASL directory data stores, aslmanager will similarly delete data files after the expiry of their time-to-live, and will delete data files (oldest first) to limit the total size as specified by ``all_max''. SEE ALSO
syslogd(8), syslog(1), asl(3), asl.conf(5), syslog(3). HISTORY
The aslmanager utility appeared in Mac OS X 10.6. Support for log file and ASL directory life-cycle management was added in OS X 10.9. Mac OS X December 7, 2007 Mac OS X