Terminating Hung Scheduled Tasks

G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

We are having a problem with an FTP which is running out of a .bat file that
is executed as a Windows Schedule Task that gets hung up. We believe the
hang is due to a broken TCP/IP session that the FTP client doesn't
recognize.

When these tasks hang, the scheduler for this FTP will hang as well, as the
DOS box the batch file runs in never gets closed out.

We've tried setting the scheduler's "Schedule Task Completed - Stop the task
if it runs for: ...." to timeout after two minutes, but it never shuts down
the hung task.

Does anyone have any ideas on how to flush these hung tasks (at least until
I find an FTP client with better error recovery)?

Thanks in advance for any help. Please post any responses to the news
group.

Ken
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

"Ken Levy" <kenl@nospam.nospam> wrote in message
news:eBmaG69sFHA.284@TK2MSFTNGP14.phx.gbl...
> We are having a problem with an FTP which is running out of a .bat file
that
> is executed as a Windows Schedule Task that gets hung up. We believe the
> hang is due to a broken TCP/IP session that the FTP client doesn't
> recognize.
>
> When these tasks hang, the scheduler for this FTP will hang as well, as
the
> DOS box the batch file runs in never gets closed out.
>
> We've tried setting the scheduler's "Schedule Task Completed - Stop the
task
> if it runs for: ...." to timeout after two minutes, but it never shuts
down
> the hung task.
>
> Does anyone have any ideas on how to flush these hung tasks (at least
until
> I find an FTP client with better error recovery)?
>
> Thanks in advance for any help. Please post any responses to the news
> group.
>
> Ken
>
>

Run kill.exe (Windows Resource Kit) or pskill.exe (www.sysinternals.com):

kill [-f] ftp.exe
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

Thanks for the response, but not quite what I need. I can terminate the
DOS box (and the FTP it is running) manually without any problems (i.e., it
is not a tight hang that needs the kill command). The problem is that this
scheduled task runs 24x7 and we only have people on site 9x5. I can
tolerate a single FTP that fails (we'll catch the files next time the task
runs), but the problem is that when we see this hang, the FTP task doesn't
terminate normally and the DOS box remains up. The task scheduler won't
start any new tasks until we manually terminate the hung FTP script by
closing the DOS box.

What I'd really love is a root-cause solution (i.e., the FTP task recognizes
the broken session and cleans up after itself with an error message instead
of hanging in limbo). Alternatively, I'd like the task scheduler to
recognize that the task has been running too long and flush it after the
timeout in the "Stop the task if it runs . . ." parameter of the job. The
key is I need the recovery to run automatically and not require human
intervention if a hang occurs.



"Pegasus (MVP)" <I.can@fly.com> wrote in message
news:uR6p5Q$sFHA.664@tk2msftngp13.phx.gbl...
>
> "Ken Levy" <kenl@nospam.nospam> wrote in message
> news:eBmaG69sFHA.284@TK2MSFTNGP14.phx.gbl...
>> We are having a problem with an FTP which is running out of a .bat file
> that
>> is executed as a Windows Schedule Task that gets hung up. We believe
>> the
>> hang is due to a broken TCP/IP session that the FTP client doesn't
>> recognize.
>>
>> When these tasks hang, the scheduler for this FTP will hang as well, as
> the
>> DOS box the batch file runs in never gets closed out.
>>
>> We've tried setting the scheduler's "Schedule Task Completed - Stop the
> task
>> if it runs for: ...." to timeout after two minutes, but it never shuts
> down
>> the hung task.
>>
>> Does anyone have any ideas on how to flush these hung tasks (at least
> until
>> I find an FTP client with better error recovery)?
>>
>> Thanks in advance for any help. Please post any responses to the news
>> group.
>>
>> Ken
>>
>>
>
> Run kill.exe (Windows Resource Kit) or pskill.exe (www.sysinternals.com):
>
> kill [-f] ftp.exe
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

You should probably start a new thread under a different heading
if you're looking for an FTP solution that auto-detects a hung
file transfer.

On the other hand, if you wish to terminate a scheduled task
after a given time then you could schedule this batch file:

@echo off
start /b "" "c:\tools\FTP Batchfile.bat"
ping localhost -n 300 > nul
c:\tools\tlist | find /i "ftp" && kill ftp

This batch file will run two separate threads. One is the FTP
transfer, the other a wait loop. After about 300 seconds,
the wait loop kills ftp if it still active.


"Ken Levy" <kenl@nospam.nospam> wrote in message
news:e4$KNh$sFHA.2948@TK2MSFTNGP15.phx.gbl...
> Thanks for the response, but not quite what I need. I can terminate the
> DOS box (and the FTP it is running) manually without any problems (i.e.,
it
> is not a tight hang that needs the kill command). The problem is that
this
> scheduled task runs 24x7 and we only have people on site 9x5. I can
> tolerate a single FTP that fails (we'll catch the files next time the task
> runs), but the problem is that when we see this hang, the FTP task doesn't
> terminate normally and the DOS box remains up. The task scheduler won't
> start any new tasks until we manually terminate the hung FTP script by
> closing the DOS box.
>
> What I'd really love is a root-cause solution (i.e., the FTP task
recognizes
> the broken session and cleans up after itself with an error message
instead
> of hanging in limbo). Alternatively, I'd like the task scheduler to
> recognize that the task has been running too long and flush it after the
> timeout in the "Stop the task if it runs . . ." parameter of the job. The
> key is I need the recovery to run automatically and not require human
> intervention if a hang occurs.
>
>
>
> "Pegasus (MVP)" <I.can@fly.com> wrote in message
> news:uR6p5Q$sFHA.664@tk2msftngp13.phx.gbl...
> >
> > "Ken Levy" <kenl@nospam.nospam> wrote in message
> > news:eBmaG69sFHA.284@TK2MSFTNGP14.phx.gbl...
> >> We are having a problem with an FTP which is running out of a .bat file
> > that
> >> is executed as a Windows Schedule Task that gets hung up. We believe
> >> the
> >> hang is due to a broken TCP/IP session that the FTP client doesn't
> >> recognize.
> >>
> >> When these tasks hang, the scheduler for this FTP will hang as well, as
> > the
> >> DOS box the batch file runs in never gets closed out.
> >>
> >> We've tried setting the scheduler's "Schedule Task Completed - Stop the
> > task
> >> if it runs for: ...." to timeout after two minutes, but it never shuts
> > down
> >> the hung task.
> >>
> >> Does anyone have any ideas on how to flush these hung tasks (at least
> > until
> >> I find an FTP client with better error recovery)?
> >>
> >> Thanks in advance for any help. Please post any responses to the news
> >> group.
> >>
> >> Ken
> >>
> >>
> >
> > Run kill.exe (Windows Resource Kit) or pskill.exe
(www.sysinternals.com):
> >
> > kill [-f] ftp.exe
> >
> >
>
>