Hi all,
Someone told me I have to use /dev/null. What is the syntax?
Cron below:
10 1 * * * /usr/local/bin/somescript
Thanks
Electron
Someone told me I have to use /dev/null. What is the syntax?
Cron below:
10 1 * * * /usr/local/bin/somescript
Thanks
Electron
Try:Quote:> Cron below:
> 10 1 * * * /usr/local/bin/somescript
10 1 * * * /usr/local/bin/somescript > /dev/null 2>&1
-Chuck
-------------+-------------------+-----------------------------------
I believe that what I'm feeling changes how the world appears. -Rush
> Someone told me I have to use /dev/null. What is the syntax?
> Cron below:
> 10 1 * * * /usr/local/bin/somescript
which sends the job's standard output to /dev/null, which discards it.
This output might also go to standard error, in which case use (may
depend on your shell)
/usr/local/bin/somescript >&/dev/null
which directs both stdout and stderr to /dev/null.
--
Nate Eldredge
Mark
> Hi all,
> Someone told me I have to use /dev/null. What is the syntax?
> Cron below:
> 10 1 * * * /usr/local/bin/somescript
> Thanks
> Electron
> Someone told me I have to use /dev/null. What is the syntax?
> Cron below:
> 10 1 * * * /usr/local/bin/somescript
> Thanks
> Electron
redirect STDOUT and STDERR to /dev/null.
regards
roy
-- Electron
>Someone told me I have to use /dev/null. What is the syntax?
>Cron below:
>10 1 * * * /usr/local/bin/somescript
>Thanks
>Electron
No, it doesn't depend on your shell, cron always uses /bin/sh.Quote:>This output might also go to standard error, in which case use (may
>depend on your shell)
See all the other responses for the correct syntax to redirect stderr.Quote:>/usr/local/bin/somescript >&/dev/null
>which directs both stdout and stderr to /dev/null.
--
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
> >This output might also go to standard error, in which case use (may
> >depend on your shell)
> No, it doesn't depend on your shell, cron always uses /bin/sh.
> >/usr/local/bin/somescript >&/dev/null
> >which directs both stdout and stderr to /dev/null.
> See all the other responses for the correct syntax to redirect stderr.
:-)
--
Tony
Thanks for asking. Most of the time I do but not on this one. It is
an ftp script running every 10 minutes.
Thanks
--Alex
On Thu, 22 Mar 2001 07:24:29 -0500, Mathew Kirsch
>> Thank you all.
>If your cron job fails, don't you want to know about it so you can fix
>whatever caused it to fail?
> Hi all,
> Someone told me I have to use /dev/null. What is the syntax?
> Cron below:
> 10 1 * * * /usr/local/bin/somescript
> Thanks
> Electron
10 1 * * * /usr/local/bin/somescript > /dev/null 2>&1
will redirect all output (including error messages)
to the "file" /dev/null. This, of-course, means that
you will not see any output from your cron job - but
then again, that's what you asked for!
Perhaps the following "man" pages would be appropriate:
sh
crontab
Good Luck,
Avi.
1. redirecting output from "cron" command
Every time I schedule a cron job I get a mail with "Output from "cron"
comman" as subject. How can I redirect the standard error output to
avoid being sent these e-mails ? Do I have to send it to the null file
? I have csh.
2. only one speaker works sndconfig
3. Command produces no output if run fom cron.
5. cron & Java command line file writing/output
7. rsh commands from cron have truncated output
8. FA310TX with linux....making it work
9. 'at' command and redirecting the cron output
10. output from rsh command stops short
11. Modify Cron mail subject from displaying "Output from Cron"
12. cron - shell script would not generate output in cron
13. cron output in /var/cron/log