This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Can't Run Excel From A Cron Job Under Windows 7
- From: "Kertz, Denis (D)** CTR **" <d dot kertz at alcatel-lucent dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Thu, 13 Nov 2014 01:22:11 +0000
- Subject: RE: Can't Run Excel From A Cron Job Under Windows 7
- Authentication-results: sourceware.org; auth=none
- References: <883F2CBBC85A62419E181EB2F0ECF21F3E1169F8 at US70UWXCHMBA04 dot zam dot alcatel-lucent dot com> <1785488620 dot 20141111221749 at yandex dot ru> <883F2CBBC85A62419E181EB2F0ECF21F3E118128 at US70UWXCHMBA04 dot zam dot alcatel-lucent dot com> <1991456701 dot 20141112231225 at yandex dot ru>
>> What I mean by runs fine is that when I type this command at a bash prompt:
>> run.excel 'c:\Shared\Bin\Create_Daily_Scorecard.xls'
>> it runs to completion and creates a new .xls as its output. When I run
>> this run.excel script from a cron job it hangs.
>
> Hangs as in - do not create new file?
Hangs as in never finishes and I don't know what, if anything, it has done. But that suggests some tests for me to run that I should have thought of. First, create a test .xls that does nothing and see if that runs to completion. If it does, then create a test .xls that simply creates a file to test whether it actually creates the file.
>> I'm not trying to run Excel interactively from a cron job. One of the
>> limitations with using Excel from a cron job is Excel has to run error free.
>> If Excel does run into some error it will typically generate an error
>> message and wait for a user response. Since Excel is running invisibly from
>> a cron job, there is no user to give a response and Excel just sits there
>> waiting for a response that will never come.
>
> Try starting cron in terminal session and see if anything comes up.
Can you tell me how to do this? When I run the ps command in a terminal session, I see this:
$ ps
PID PPID PGID WINPID TTY UID STIME COMMAND
5780 5568 5780 3408 pty0 1000 Nov 5 /usr/bin/bash
5568 1 5568 5568 ? 1000 Nov 5 /usr/bin/mintty
3716 5780 3716 1016 pty0 1000 18:58:16 /usr/bin/ps
1820 1 1820 1820 ? 1000 Nov 5 /usr/bin/cygrunsrv
1856 1820 1856 1892 ? 1000 Nov 5 /usr/sbin/cron
Do I have to kill the cygrunsrv and cron processes and then ??
>> Why "of course"? Shouldn't I be able to kill my own processes?
>
> It's not "your own" process, it's "cron job" started with your credentials.
>
>> I can certainly do that under WinXP.
>
> Again, only if you logged in as admin.
> This is not the case in Vista+ by default.
Okay, I think what you are telling me is that the login I'm using on "my" WinXP PC (which I inherited) must be an administrator login and the login I'm using on the Win7 PC is not an administrator login (it isn't). That sounds plausible (I know a lot more about UNIX than I do about Windows). So the differences I'm seeing between WinXP and Win7 is due to using/not using an administrator login, not due to whether it is WinXP or Win7.
Denis
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple