Where does standard output from at and cron tasks go, given there is no screen to display to?

It's not appearing in the directory the jobs were started from, nor in my home directory.

How could I actually figure this out given that I don't know how to debug or trace a background job?

  • Output is usually sent via email. Commented Jun 12, 2012 at 19:23
  • I recommend using mutt, "a small but very powerful text-based mail client", to read the output. It is has been in the repositories for every distro I've used.
    – kwarrick
    Commented Jun 12, 2012 at 19:35

3 Answers 3


From the cron man page:

When executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). The children copies of cron running these processes have their name coerced to uppercase, as will be seen in the syslog and ps output.

So you should check your/root's mail, or the syslog (eg. /var/log/syslog).

  • On my mac, after simply calling "cron" it displayed the path to the "email". In my case , it was /var/mail/<username>. Commented Oct 19, 2015 at 3:03

For long-running processes it is sometimes useful to know what the output is before you get the email, I use this instead:

  1. Use ps to find the process ID of your running program (PID below);
  2. use lsof to find the file the output is being written to:

    lsof -p PID

In the output, look for the 1u and 2u lines under the FD column header.

These lines will tell you what temporary files the process output is going into before it is sent by mail. Typically, for at, the file is located under /var/spool/cron/atjobs/. Finally, display that file and you will find your process' (current) output.

  • the files under 1u and 2u are of type UNIX. I'm guessing these are UNIX sockets. How do I look into the files now?
    – kapad
    Commented Jan 28, 2020 at 5:46
  • What to do when 1u and 2u files appear as (deleted) (although the process itself is still running)? Commented Feb 20, 2021 at 13:58

@kapad, @janaka: This is now answered in How can I access a deleted open file on Linux (output of a running crontab task)?

So in this case, you'd do a something along the lines of

"tail /proc/[the-pid]/fd/1"

You must log in to answer this question.

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