1

Running 'at' on either Debian Jessie or Raspbian Jessie, output seems to go down a black hole whatever I do. I'm wanting to capture errors, but even in the simple case of stdout I can't seem to capture output.

I'm trying, for example:

echo "curl 'http://www.example.com' > tmp.log" | at -M -t 201706042241.36

tmp.log is always empty, but the same curl not put through at produces the expected html. If I omit the -M I get nothing.

What I really want is the error output. If I try

echo "curl 'http://badbadbad.example.com' 2>&1 > tmp.log" | at -M -t 201706042241.36

I get an empty tmp.log; and if I omit -M I get an empty email. If I omit the redirects, thus:

echo "curl 'http://badbadbad.example.com'" | at -t 201706042241.36

I also get an empty email. I'd expect to see curl: (6) Could not resolve host: badbadbad.example.com

There's nothing in syslog, messages or daemon.log in /var/log. I'm running the commands as an ordinary user, not root.

at seems to hijack and discard every attempt to obtain the output from the command I'm running. Am I misunderstanding something about at?

1
  • Your first command produces the expected output for me. (Gentoo though.) Jun 6, 2017 at 17:21

1 Answer 1

1

You are trying to pipe | the output of your commands to at instead of giving it the commands to be run at the time specified. at reads the commands from the standard input (at> prompt) or from a file (-f). Synopsis:

at [-V] [-q queue] [-f file] [-mldbv] TIME
at [-V] [-q queue] [-f file] [-mldbv] -t time_arg

Here's a good article with usage examples.

2
  • No I'm not - I'm echo-ing the commands into at, which reads commands to be executed from stdin. The commands (curl ...) work, at the time requested, it's the capturing the output from them that's the problem. Jun 6, 2017 at 12:01
  • My bad. I tested the last command and the result was as expected. Jun 6, 2017 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .