This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Cron problem/Documentation and Setup


On Wed, 18 Aug 2004, Dave Korn wrote:

> > -----Original Message-----
> > From: Igor Pechtchanski
> > Sent: 18 August 2004 17:19
> 
> > On Wed, 18 Aug 2004, Dave Korn wrote:
> > 
> > > > -----Original Message-----
> > > > From: cygwin-owner On Behalf Of Igor Pechtchanski
> > > > Sent: 18 August 2004 16:54
> > > 
> > > > > > > 18 17 * * * pwd >> /tmp/debug.log 2>&1
> > > > > > > 19 17 * * * ls >> /tmp/debug.log 2>&1
> > > > > > > 20 17 * * * ls -l /tmp/myscript >> /tmp/debug.log 2>&1
> > > > > > > 21 17 * * * /tmp/myscript >> /tmp/debug.log 2>&1
> > > 
> > > > 19 17 * * * ls >> /tmp/debug.log 2>&1
> > > > 20 17 * * * ls -l /tmp/myscript >> /tmp/debug.log 2>&1
> > > 
> > >   I haven't been following, so PMFBI, but can I just point out that 
> > > it may well be necessary that the 2>&1 should precede the >> 
> > > /tmp/debug.log if you want stderr to actually end up in the log 
> > > file....
> > 
> > Nope, that part was correct.  If you put 2>&1 before the >> 
> > redirection, stderr will end up on stdout.  See the sh and bash 
> > manpages.
> 
>   My bad.  GOK how I managed to misremember that, but I was sooo certain 
> that I'd had to painfully discover that they needed to be the other way 
> round myself once.  Guess I must have discovered it the way round you've 
> got it, after all.  I just tested redirection under cmd.exe and even 
> that behaves the same way, so I didn't even get it from M$-world.  
> Pardon my confabulation.
> 
> > >   BTW, "uname -a; pwd; set; export" might be a good diagnostic 
> > > command to add as a cron job.... isn't this almost certainly a 
> > > wrong-user-executing-the-job problem?
> > 
> > Huh?  "uname -a" should only be useful if there's more than one Cygwin 
> > version on the machine -- otherwise, the output should be identical 
> > for all users.  "pwd" is already there.  I don't see how "set;export;" 
> > is relevant at all, frankly...  Did you, by chance, mean "id" instead?
> 
>   I meant "id" rather than uname, yes.  As for "set; export", I don't 
> see how you can consider the execution environment to _not_ be relevant; 
> it's full of useful and even vital diagnostic information, such as 
> $PATH, to name but one....

Ah, my turn to play dumb.  I didn't realize that "set;export" will 
actually print out the environment and the exported names.  Moreover, I 
didn't realize it'll do so under "/bin/sh" as well.  Oh, well, ignore that 
last comment about "set;export", please...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]