1

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.

2
  • 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
    – mmmmmm
    Jun 17, 2013 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. Jun 18, 2013 at 4:49

2 Answers 2

4

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.

3
  • 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. Jun 18, 2013 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. Jun 18, 2013 at 4:44
  • Note to self, towards making visible the end result in Finder: stackoverflow.com/q/13820485/38108 Jun 18, 2013 at 5:46
0

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.

2
  • It's not ridiculous to make me aware :-) – thanks – but the requirement to sign up will probably be unpalatable to the end users … Jun 17, 2013 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, 2013 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .