Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] chrony logrotate script EOF error
Date: Sun, 22 Aug 2010 16:45:30
Message-Id: 201008221744.54658.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] chrony logrotate script EOF error by Alan McKinnon
1 On Sunday 22 August 2010 17:25:02 Alan McKinnon wrote:
2 > Apparently, though unproven, at 12:11 on Sunday 22 August 2010, Mick did
3 > opine
4 >
5 > thusly:
6 > > Hi All,
7 > >
8 > > The chrony installed logrotate script keeps erroring out:
9 > > ========================================================
10 > > logrotate_script: line 5: warning: here-document at line 2 delimited by
11 > > end- of-file (wanted `EOF')
12 > > Unrecognized command
13 > > ========================================================
14 > >
15 > > This is the script:
16 > > ========================================================
17 > > /var/log/chrony/*.log {
18 > >
19 > > sharedscripts
20 > > postrotate
21 > >
22 > > PASSWORD=`awk '$1 ~ /^1$/ {print $2; exit}'
23 > >
24 > > /etc/chrony/chrony.keys`
25 > >
26 > > cat << EOF | /usr/bin/chronyc | sed '/^200 OK$/d'
27 > > password $PASSWORD
28 > > cyclelogs
29 > > EOF
30 > >
31 > > endscript
32 > >
33 > > }
34 > > ========================================================
35 > >
36 > > I do not understand the error. Is it telling me to add backticks?
37 > > Where?
38 >
39 > No, it's saying it wants EOF on a line all by itself with no leading
40 > whitespace. That thing that looks like a backtick is an open quote.
41
42 Hmm ... so what should the corrected logrotate script look like then?
43
44 cat <<
45 EOF
46 | /usr/bin/chronyc | sed '/^200 OK$/d'
47 password $PASSWORD
48 cyclelogs
49 EOF
50 endscript
51 }
52 --
53 Regards,
54 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] chrony logrotate script EOF error Alan McKinnon <alan.mckinnon@×××××.com>