I wanted to schedule a job with at command and see this error:

    [root@labeir1 exm]# date
    Sun Dec  9 01:54:45 IST 2012
    [root@labeir1 exm]# at 01:47 "df -kh"
    syntax error. Last token seen: d
    Garbled time

Even the same without quotes doesn't work.

Whereas when i schedule the same command to be executed like this:

    [root@labeir1 exm]# echo df -kh | at 01:47
    job 4 at 2012-12-10 01:47

It shows that the job is scheduled, but at that particular time I don't see the output. Is it not that the output will be seen on the console?


No, the output will not appear on the console.  I would expect the output to be e–mailed to you.  Try

echo df –kh | at –m 01:47

to explicitly ask for e–mail, or

echo "df –kh > df_output.txt" | at 01:47

to write to a file.


Try with something like:

mesg y # this is just to make sure you may write to your user
at now + 1 min
at>df -kh | write $USER

If that doesn't work, you either haven't got util-linux installed with pty-helper flag enabled or you need to specify the display in which you want the output (it is probably $DISPLAY)

Note that if you do something like:

at now + 1 min

It would probably work if you've got xterm installed (test it with whatever terminal you use). So, I'm guessing that the real problem is that the command is being executed in the background and you need to pull the string you want to prompt and do whatever you need with it (maybe send it to any user with write or wall commands).


Try removing the :, so :

echo 'df -kh' | at 0147
  • If you think that the answer is useful, you can 'upvote' it. You can 'accept' the reply too by clicking the outline of the checkmark (will be green), this way, people searching on the website will known that the question is well answered. That's how stackechange websites works, thanks ;) – Gilles Quenot Dec 9 '12 at 11:34
  • 6
    The confirmation message job 4 at 2012-12-10 01:47 suggests that at is parsing the 01:47 correctly. – Scott Dec 11 '12 at 2:56

A bit of a side-note, but as I have always been struggling with the "garbled time" output of at, I'd thought I share my fix for that. My solution is to wrap at in a function and use the, more forgiving, date to fix the garbled time messages.

function at {
  unset IFS
  AT=$(which at)

  # First try at to see if I finally figured out to produce non-garbled time
  if ${AT} ${MOMENT} 2>/dev/null
    # worked allright, we can exit
    # We produced garbled time (duh), so let's fix this with date
    MOMENT=$(date --date "${MOMENT}" +'%Y%m%d%H%M')

  # and try again
  ${AT} -t ${MOMENT}

This works best on systems that have GNU date installed (most linux systems).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.