SUMMARY: Solaris 9 - logadm and quotes

2007-12-24 23:10:00

Hello,

I got one reply to this from Philip.Miller at ogilvy.com, who suggested simply
using underscores (hard spaces) rather than actual ones. Pretty obvious when
you think about it :-) Not ideal, but perfectly okay in this situation since
hopefully mail messages will only be sent very rarely.

John.

The original message:

Has anyone got Solaris 9's logadm to work when using embedded quotes? I'm
basically trying to do something like:

/var/adm/backups -s 0b -b 'test -s /var/adm/backups || (echo | mailx -s
"Backup log is empty" root)'

which should test if the file is empty before rotating it. If it is empty
then email root; if not then just rotate the file.

However, trying to enter the command I get:

logadm -w /var/adm/backups -s 0b -b 'test -s /var/adm/backups ||
(echo | mailx -s "Backup log is empty" root)'
logadm: /etc/logadm.conf line 49: Error: Can't protect quotes in <test -s
/var/adm/backups || (echo | mailx -s "Backup log is empty" root)>
logadm: Error: bailing out due to command line errors
Use "logadm -h" for help.

No matter what combination of single quotes, double quotes and '\' I use, I
just cannot seem to get it to accept embedded quotes. Anyone any ideas or
done this? It seems a reasonable request to to test for an empty file so
that we can check if backups are indeed running (yes, there are other ways
of doing this).

------------------------------------------------------------------------
John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914
E-mail: jhorne at plymouth.ac.uk
PGP key available from public key servers

Comments

Got something to say?

You must be logged in to post a comment.