In article <
32d79aec-3844-476a...@googlegroups.com>,
Chris Roberts <
thec...@gmail.com> wrote:
>crontab issue:
>Hi perhaps someone would have some ideas?
>I want to run my script via crontab,
>Problem: via crontab it successfully creates tmp1.txt and directs output to that
>file, it can't seem to bring the output back to tty terminal again.
>
>Question: How do I get crontab to behave like when I just run the file straight?
The basic answer is that there is no "tty terminal" when running in crontab.
The "tty" command will return "not a tty" (you can verify this by typing,
at a regular terminal prompt: tty < /dev/null).
Now, as to your basic question/problem: What you need to do is forget
about directing stuff to a tty (since there is no tty to direct it to) and
instead rely on the fact that the CRON daemon will email you the "results"
of your cronjob. Here, by "results", we mean the combined output of
"stdout" and "stderr".
Now, the thing is, on a regular, full-blown, fully configured, fully
functional Unix system, this all will "just work". You would have already
worked out that the output you seek is in your email inbox. But, I'm going
to guess here that you are running this on some kind of minimal Unix
system, where there is no MTA (*) setup/configured. In that case, you need
to setup an MTA - which can be either an easy, 2 minute task, or a several
days/weeks task, depending on how you choose to go about it.
I'm going to leave it there for now; please respond further if you need
further help.
(*) MTA = "Mail Transfer Agent"
--
> No, I haven't, that's why I'm asking questions. If you won't help me,
> why don't you just go find your lost manhood elsewhere.
CLC in a nutshell.