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

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



Maybe, because crond is running as root, try put this lines in your script


ls -l /proc/self/fd/1
ls -l /dev/stdout

please, you can tell us, how you scheduled the script in crond?

Thanks

2014-08-22 11:23 GMT+02:00 Tony van der Hoff <tony@vanderhoff.org>:
> Hi,
>
> Running up-to-date Wheezy.
>
> I have a script, simplified like this:
>
> -----------------------------
> #!/bin/bash
> DEBUG=1
>
> OUT=/dev/null
>
> if [ $DEBUG -ne 0 ]; then
>         OUT=/dev/stdout
> fi
>
> echo hello > $OUT
> -----------------------------
>
> This works fine when invoked from the command line, but when called as a
> cron task, same user, it fails with
> /home/tony/scripts/test: line 10: /dev/stdout: Permission denied
>
> Any suggestions on how to fix this, please?
> --
> Tony van der Hoff  | mailto:tony@vanderhoff.org
> Ariège, France     |
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 53F70C19.2020902@vanderhoff.org">https://lists.debian.org/[🔎] 53F70C19.2020902@vanderhoff.org
>



-- 
esta es mi vida e me la vivo hasta que dios quiera


Reply to: