Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Background

I have this command to create a temporary collection of selected log files –

sudo tar -czf $TMPDIR/archive\ of\ install.log\ and\ system.log\ files\ only.tgz --options='compression-level=9' /private/var/log/*install* /private/var/log/*system* && sudo chmod 666 $TMPDIR/archive\ of\ install.log\ and\ system.log\ files\ only.tgz && open $TMPDIR

– but it's usable only if the user at the command line is an administrator.

A Pacifist view of an archive produced by that command:

enter image description here

Question

For OS X, is there a user-friendly third party app that can create an archive of a comparable collection of log files?

The ideal app:

  • should work for normal users (and if so, must prompt for administrator credentials, which will be required to access some of the data)

  • may be relatively system-agnostic (not limited to Mountain Lion).


Approaches that I have ruled out

Console

It's great for many things, but not for collecting and archiving in the way outlined above.

Finder

It's user friendly but I'd prefer something that can perform the collection in a single step, or two – without browsing to the source directory. Moreover:

  • a normal user can not use Finder to compress the required files.

Apple sysdiagnose

It's powerful and fairly comprehensive, but can be unexpectedly time-consuming.

Only the most recent system.log file is archived.

share|improve this question
1  
The permissions on the install system logs are such that they are only readable by Administrators so all access will need to be authenticated –  Mark Jun 17 '13 at 20:22
    
To clarify: the app will be for an administrative user who may be sometimes logged in as a normal user. They'll be prepared to enter credentials, but probably not prepared to log out (or fast user switch). Imagine, if you like, a need to collect log files quickly and with minimal disruption. –  Graham Perrin Jun 18 '13 at 4:49

2 Answers 2

up vote 3 down vote accepted

Could you use an AppleScript like this?

do shell script "tar --disable-copyfile -cf ${TMPDIR}logs.tar /var/log/{system,install}.log*" with administrator privileges

It requires entering the username and password of an admin user though.

share|improve this answer
    
Perfect – it'll be user-friendly, and it matches both ideals. I imagined AppleScript being used but my knowledge was rusty. I might add another answer for the "and the like" part of the subject line but this is the accepted answer. –  Graham Perrin Jun 18 '13 at 4:29
    
Whilst options such as --disable-copyfile are not documented by Apple (in its tar(1) Mac OS X Manual Page) the option is explained in Super User. –  Graham Perrin Jun 18 '13 at 4:44
    
Note to self, towards making visible the end result in Finder: stackoverflow.com/q/13820485/38108 –  Graham Perrin Jun 18 '13 at 5:46

This is a bit of a ridiculous answer, but I've been toying with the free tier of splunk for this purpose.

It's actually a fairly heavy (in feature) web front end and a hadoop back end database to collect all log messages and make them searchable, indexable and actionable.

I wouldn't call it user-friendly per-se to set up, but the web interface isn't bad. But if you can install it and get it running, you probably have the tools to roll your own archive solution using terminal commands.

share|improve this answer
    
It's not ridiculous to make me aware :-) – thanks – but the requirement to sign up will probably be unpalatable to the end users … –  Graham Perrin Jun 17 '13 at 20:25
1  
The software is licensed and requires you to register, but other than your time and email address, I've found them to honor requests to not email you unless you opt in to mailings from the company. For most use cases, the software is routinely free if you request a license after evaluating it. –  bmike Jun 17 '13 at 20:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.