Solaris 9 - logadm and quotes

From: John Horne (J.Horne@plymouth.ac.uk)
Date: Wed Jun 26 2002 - 07:33:37 EDT


Hello,

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).

Regards,

John.

------------------------------------------------------------------------
John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914
E-mail: jhorne@plymouth.ac.uk
PGP key available from public key servers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:31 EDT