0

I've got a cron job configured to run a command like

some-command 2>&1 >/dev/null | tee -a /tmp/some-command.STDERR.$(date +\%Y-\%m-\%d.\%H.\%M)

I've also got a tmpreaper cron job that tidies up older logs. Every now and then a process goes haywire and eats up all the disk space too quickly (I'm debugging that, but it's not what this question is about). When that happens, it seems like "tee" gets wedged permanently with a "No space left on device" error; it doesn't matter that tmpreaper eventually steps in to make room, the process never recovers.

The only point of tee-ing the stderr is to be able to check in on what the process is up to in real time. However that output also eventually appears in the email that cron sends after I (inevitably) kill the process. It stands to reason that cron has its own file on some other partition that is collecting the stderr logs on my behalf. But I can't figure out where that file is. Any tips?

1
  • 1
    run job manually sh -x script, you'll be able to see more..
    – alexus
    Jul 31, 2014 at 18:55

1 Answer 1

2

Cron doesn't send the output from jobs to a temporary file. Instead it invokes the mail command once it sees any output from the job and copies the output directly to mail's input. Confirmed this by checking the source for Vixie cron but others will probably do the same.

You must log in to answer this question.

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