SPAWN result [message #93206] |
Thu, 12 May 2016 06:19  |
khyde
Messages: 21 Registered: November 2013
|
Junior Member |
|
|
Hello,
I have a wget spawn command that runs every night and is terminated in the morning by another program if it has not finished downloading. What I would like to know is how can I tell if the process completed on its own or was terminated. I've tried including RESULT and ERROR in the call, but they both return empty strings.
SPAWN, WGET_CMD, WGET_RESULT, WGET_ERROR
Is there anyway to figure out if this job completed or was terminated? I could check the last line of the log file, but I was hoping there was an easier way.
Thanks,
Kim
|
|
|
Re: SPAWN result [message #93207 is a reply to message #93206] |
Thu, 12 May 2016 07:15   |
jiashenyue
Messages: 10 Registered: January 2013
|
Junior Member |
|
|
On Thursday, May 12, 2016 at 6:19:24 AM UTC-7, KH wrote:
> Hello,
>
> I have a wget spawn command that runs every night and is terminated in the morning by another program if it has not finished downloading. What I would like to know is how can I tell if the process completed on its own or was terminated. I've tried including RESULT and ERROR in the call, but they both return empty strings.
>
> SPAWN, WGET_CMD, WGET_RESULT, WGET_ERROR
>
> Is there anyway to figure out if this job completed or was terminated? I could check the last line of the log file, but I was hoping there was an easier way.
>
> Thanks,
> Kim
Good question. And this is a major shortcoming of SPAWN. I was always using SPAWN under Mac OS X and I found the only way to track if the session has finished is by looking at the tasks and threads from the Activity Monitor of the system. If you are using Windows, you may have to track it from the Task Manager of the system. SPAWN does not provide any verbose output even if your own program is written in this way.
Not sure if the following link from this group is somewhat helpful but you can give it a try.
CPU Process Manager Library / Parallel Processing
https://groups.google.com/forum/?utm_source=digest&utm_m edium=email#!topic/comp.lang.idl-pvwave/8RTM6eBUhzY
Thanks to Nata, the composer of this library!
Shenyue
|
|
|
Re: SPAWN result [message #93213 is a reply to message #93207] |
Fri, 13 May 2016 03:05   |
Markus Schmassmann
Messages: 129 Registered: April 2016
|
Senior Member |
|
|
On 05/12/2016 04:15 PM, SHENYUE JIA wrote:
> On Thursday, May 12, 2016 at 6:19:24 AM UTC-7, KH wrote:
>> I have a wget spawn command that runs every night and is terminated in the morning by another
>> program if it has not finished downloading. What I would like to know
is how can I tell if the
>> process completed on its own or was terminated. I've tried including
RESULT and ERROR in the
>> call, but they both return empty strings.
>>
>> SPAWN, WGET_CMD, WGET_RESULT, WGET_ERROR
>>
>> Is there anyway to figure out if this job completed or was terminated? I could check the last
>> line of the log file, but I was hoping there was an easier way.
> Good question. And this is a major shortcoming of SPAWN. I was always using SPAWN under Mac OS X
> and I found the only way to track if the session has finished is by
looking at the tasks and
> threads from the Activity Monitor of the system. If you are using
Windows, you may have to track
> it from the Task Manager of the system. SPAWN does not provide any
verbose output even if your own
> program is written in this way.
>
> Not sure if the following link from this group is somewhat helpful but you can give it a try.
>
> CPU Process Manager Library / Parallel Processing
>
> https://groups.google.com/forum/?utm_source=digest&utm_m edium=email#!topic/comp.lang.idl-pvwave/8RTM6eBUhzY
>
> Thanks to Nata, the composer of this library!
have you tried this?
SPAWN, WGET_CMD, WGET_RESULT, WGET_ERROR, EXIT_STATUS=variable
not sure it will do what you need, but if it should if I remember wget
correctly
Markus
|
|
|
Re: SPAWN result [message #93214 is a reply to message #93206] |
Fri, 13 May 2016 04:36   |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
The result information contains the process ID. Note that on Unix the command must not end with & or the result will be empty. Once you have the process id your can use a spawn to ps, parse the output to check whether the process is alive. Since the spawn process is blocking, you may have to use the IDL Bridge of you want your application to continue.
On Thursday, May 12, 2016 at 9:19:24 AM UTC-4, KH wrote:
> Hello,
>
> I have a wget spawn command that runs every night and is terminated in the morning by another program if it has not finished downloading. What I would like to know is how can I tell if the process completed on its own or was terminated. I've tried including RESULT and ERROR in the call, but they both return empty strings.
>
> SPAWN, WGET_CMD, WGET_RESULT, WGET_ERROR
>
> Is there anyway to figure out if this job completed or was terminated? I could check the last line of the log file, but I was hoping there was an easier way.
>
> Thanks,
> Kim
|
|
|
Re: SPAWN result [message #93215 is a reply to message #93214] |
Fri, 13 May 2016 05:10  |
khyde
Messages: 21 Registered: November 2013
|
Junior Member |
|
|
Thanks for the ideas. I found the easiest thing for me to do right now is check the last line of the log file and if it doesn't start with "Downloaded:" then I know the wget step did not complete.
Kim
On Friday, May 13, 2016 at 7:36:36 AM UTC-4, Haje Korth wrote:
> The result information contains the process ID. Note that on Unix the command must not end with & or the result will be empty. Once you have the process id your can use a spawn to ps, parse the output to check whether the process is alive. Since the spawn process is blocking, you may have to use the IDL Bridge of you want your application to continue.
>
> On Thursday, May 12, 2016 at 9:19:24 AM UTC-4, KH wrote:
>> Hello,
>>
>> I have a wget spawn command that runs every night and is terminated in the morning by another program if it has not finished downloading. What I would like to know is how can I tell if the process completed on its own or was terminated. I've tried including RESULT and ERROR in the call, but they both return empty strings.
>>
>> SPAWN, WGET_CMD, WGET_RESULT, WGET_ERROR
>>
>> Is there anyway to figure out if this job completed or was terminated? I could check the last line of the log file, but I was hoping there was an easier way.
>>
>> Thanks,
>> Kim
|
|
|