On Sunday 22 August 2010 17:25:02 Alan McKinnon wrote:
> Apparently, though unproven, at 12:11 on Sunday 22 August 2010, Mick did
> opine
>
> thusly:
> > Hi All,
> >
> > The chrony installed logrotate script keeps erroring out:
> > ========================================================
> > logrotate_script: line 5: warning: here-document at line 2 delimited by
> > end- of-file (wanted `EOF')
> > Unrecognized command
> > ========================================================
> >
> > This is the script:
> > ========================================================
> > /var/log/chrony/*.log {
> >
> > sharedscripts
> > postrotate
> >
> > PASSWORD=`awk '$1 ~ /^1$/ {print $2; exit}'
> >
> > /etc/chrony/chrony.keys`
> >
> > cat << EOF | /usr/bin/chronyc | sed '/^200 OK$/d'
> > password $PASSWORD
> > cyclelogs
> > EOF
> >
> > endscript
> >
> > }
> > ========================================================
> >
> > I do not understand the error. Is it telling me to add backticks?
> > Where?
>
> No, it's saying it wants EOF on a line all by itself with no leading
> whitespace. That thing that looks like a backtick is an open quote.
Hmm ... so what should the corrected logrotate script look like then?
cat <<
EOF
| /usr/bin/chronyc | sed '/^200 OK$/d'
password $PASSWORD
cyclelogs
EOF
endscript
}
--
Regards,
Mick
signature.asc
Description: This is a digitally signed message part.

