[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: writing to /dev/stdout fails in cron script



Tony van der Hoff <tony@vanderhoff.org> wrote:
 
> Cron task is invoked from a simple crontab entry:
> # /home/tony/crontab -- crontab for user tony
> MAILTO=tony@vanderhoff.org
> SHELL=/bin/sh
> <snip>
> * * * * *       /home/tony/scripts/test

> tony@tony-fr:~$ ls -al /dev/stdout
> lrwxrwxrwx 1 root root 15 Aug 21 17:30 /dev/stdout -> /proc/self/fd/1

> tony@tony-fr:~$ ls -ald /dev
> drwxr-xr-x 15 root root 3340 Aug 21 17:30 /dev

At least you don't have a multi-gigabyte /dev/stdout-file on your system
filled with the output of numerous scripts from years ago :)

I'd guess /proc/self/fd/1 is different for programs invoked from cron,
because cron redirects stdout to catch any output from programs.

Please add something like this:

  ls -al /proc/self/fd/1 /dev/stdout 2>&1 > /tmp/testoutput

to your script and provide the output. Maybe this will be helpful.

Grüße,
Sven.

-- 
Sigmentation fault. Core dumped.


Reply to: