Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bcstec!randall From: randall@bcstec.boeing.com (Michael Randall) Newsgroups: comp.sys.apollo Subject: Re: Ping looses its ouput when run by cron Message-ID: <753@bcstec.boeing.com> Date: 22 Mar 91 22:01:43 GMT References: <174@ladwp> Distribution: na Organization: Boeing Computer Services, Seattle Lines: 31 In article <174@ladwp>, carlson (Carlson Peters) writes: > I have a ksh script that runs the the following ping command: > ping node_name 64 3 1>ping.rpt > When I run the script from a shell or using 'at' all works fine. However, > I really want to run this script from cron. Problem is, ping.rpt is created > but empty when cron runs it. When I tried this from a IBM risc station, it > ran without a hitch. What am I missing here? Cron runs /bin/sh by default. You didn't say here so I'm not sure, but if you want a shell script to run a particular shell you must include as the first line in the file, from column one, #!/bin/ksh (substitute your favorite shell in for ksh). #!/bin/csh shell stuff..... The difference in input re-direction could be part of your problem, I'm not sure since I don't speak "ksh". Also, you should make sure you use a complete path names to files, and not assume anything. The less assumptions the better/safer. The resulting shell script would look like this: #!/bin/ksh /etc/ping node_name 64 3 1> /user/johndoe/ping.rpt Let me know it that helps, (I do accept E-mail) :) -- -------------------- Peace Love & E-Mail ---------------------------------- Michael W. Randall | Phone: (206) 965-9557 randall@bcstec.boeing.com | This space for rent... ...!uunet!bcstec!randall | ...Inquire within.