🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.gnus
Article #917

Re: gnus-agent-fetch in batch mode in a cron job

#917
From: W. Greenhouse
Date: Fri, 22 Feb 2013 06:32
72 lines
5255 bytes
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Julien,

Julien Cubizolles <j.cubizolles@free.fr> writes:

> From what I understand Emacs outputs the whole *Messages* buffer to
> stdout. So there is nothing the shell can do to sort error messages from
> information messages. Is that right=C2=A0?

Hrm, you're not quite correct, but I'm not sure it actually matters.
From=20(info "(emacs) Initial Options"):

> `-batch'
> `--batch'
>      Run Emacs in "batch mode".  Batch mode is used for running
>      programs written in Emacs Lisp from shell scripts, makefiles, and
>      so on.  To invoke a Lisp program, use the `-batch' option in
>      conjunction with one or more of `-l', `-f' or `--eval' (*note
>      Action Arguments::).  *Note Command Example::, for an example.

>      In batch mode, Emacs does not display the text being edited, and
>      the standard terminal interrupt characters such as `C-z' and `C-c'
>      have their usual effect.  Emacs functions that normally print a
>      message in the echo area will print to either the standard output
>      stream (`stdout') or the standard error stream (`stderr') instead.
>      (To be precise, functions like `prin1', `princ' and `print' print
>      to `stdout', while `message' and `error' print to `stderr'.)
>      Functions that normally read keyboard input from the minibuffer
>      take their input from the terminal's standard input stream
>      (`stdin') instead.

etc.

So which file descriptor emacs --batch sends printed output to does
actually depend on the function being called.  And looking at the source
of gnus-agent, it does look like functions like `signal' and `error' are
consistently used as they should be, for actual network errors--which is
good.  However, `message' is also used frequently, e.g. for the
"Checking new news..." in `gnus-group-check-new-news.'  So it's not
guaranteed that stderr will only contain errors.  So, you might actually
be better off either redirecting all output to /dev/null (as the example
in (info "(gnus) Batching Agents") does), or else redirect to a log
file.

=2D-
Regards,
WGG

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJRJxDtAAoJEC6LG3QNLT+e0woQANyJDuUHz+lTKxbQkwPgqcUg
gKyugRQErky5qd1s2TyyCzcbDyVU8zo5Lq39MMvgEkcgx0BS0s/ZIzp51eEjHdK/
Tx0zqvQlHIlXcT+HOn2Pd3z6P1sayF5JOEq7jTnxEVYEEEKawAfNyIix8Wd2OXMX
dzWmF3TUA+Mlv6Zr7Ox/uksgMGxKvKwx3t2Df9hCc/QbxR29kYBN3AoWK7HavA/g
6O3ELRNhj+uUQpdtSGsHHDUK/scVGbQIHtKjC+zw+ys7PvVTgt4wfRdBnnhjd/n/
4uWLW2bYiUEVmFrUGPwu8ggovTD28vujKFsWxZggkwCKBvl4aWW1/ee3hNFc7LIw
eBkErXgik96iQT9cWQ3sNzgkbLT31Xz7qf1sm3hhfwKqVzNgF8rZD24eMx/fP5e4
rUpXvZTRvs7SDtT5OpTVk40qWmV8Zal0xWT2uZCftVmPZcJhZ8ViK/O6gWrCep2W
Gel27mobfzh7eAtooBW4yF1R+qHxCX6RrkGZYGqnB5BUMutWUndA9gVWxbDi7JbN
9aDQVNy1WogUeMeezh8wz6m/K2L+/ruHJZ6DWGt47gM4xhg/P1qlXU7KmQl1H9hu
Hvw7JKiwarvj7yd4hFxdww3sovRQDf+ngyT/ebPx+xgjfFsa0tbfHrLdsMxKeIDb
FoNLNyq89cI+lMq4Bdn6
=2VB5
-----END PGP SIGNATURE-----
--=-=-=--
Technical Details
Message-ID: <mailman.20576.1361514760.855.info-gnus-english@gnu.org>
Path: arc1-ca.pugleaf.net!ov8ni14049pbb.1!nntp.google.com!news.glorb.com!usenet.stanford.edu!not-for-mail
References: <87liarooj7.fsf@free.fr> <878v6jszx6.fsf@riseup.net> <87r4k8lvyr.fsf@free.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1016f0,c483693d7afdde38
X-Google-NewGroupId: yes
X-Google-Attributes: gid99bd902dcd,domainid0,public,usenet
X-Google-Language: ENGLISH,UTF8
X-Received: by 10.66.227.7 with SMTP id rw7mr174308pac.19.1361514760838;
        Thu, 21 Feb 2013 22:32:40 -0800 (PST)
Path: arc1-ca.pugleaf.net!ov8ni14049pbb.1!nntp.google.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From: wgreenhouse@riseup.net (W. Greenhouse)
Newsgroups: gnu.emacs.gnus
Subject: Re: gnus-agent-fetch in batch mode in a cron job
Date: Fri, 22 Feb 2013 06:32:12 +0000
Lines: 74
Approved: info-gnus-english@gnu.org
Message-ID: <mailman.20576.1361514760.855.info-gnus-english@gnu.org>
References: <87liarooj7.fsf@free.fr> <878v6jszx6.fsf@riseup.net>
 <87r4k8lvyr.fsf@free.fr>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha1; protocol="application/pgp-signature"
X-Trace: usenet.stanford.edu 1361514760 955 208.118.235.17 (22 Feb 2013 06:32:40 GMT)
X-Complaints-To: action@cs.stanford.edu
To: info-gnus-english@gnu.org
Envelope-to: info-gnus-english@gnu.org
X-Injected-Via-Gmane: http://gmane.org/
X-Gmane-NNTP-Posting-Host: torrouter.ucar.edu
X-Archive: encrypt
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
Cancel-Lock: sha1:OktNBaSLCbSYljwlovpsdVBgOhE=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 80.91.229.3
X-BeenThere: info-gnus-english@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Announcements and discussions for GNUS,
 the GNU Emacs Usenet newsreader \(in English\)"
 <info-gnus-english.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/info-gnus-english>,
 <mailto:info-gnus-english-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/info-gnus-english>
List-Post: <mailto:info-gnus-english@gnu.org>
List-Help: <mailto:info-gnus-english-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/info-gnus-english>,
 <mailto:info-gnus-english-request@gnu.org?subject=subscribe>