-
1. Re: blcli Email sendMailWithAttachment not working correctly
Bill RobinsonNov 1, 2019 10:35 AM (in response to Parag Desai)
are you sure it's exiting the loop?
put a 'set -x' at the top of the script and re-run it.
-
2. Re: blcli Email sendMailWithAttachment not working correctly
Parag Desai Nov 1, 2019 11:22 AM (in response to Bill Robinson)The blcli to send email is definitely outside of the 'for' loop.
After setting 'set -x' I see that the copy of xyz.csv and blcli to send email is being run by each and every server. That means somehow, the loop is not exiting.
Can you please check whether the issue is reproducible for NSH Script Type 1?
I have Type 2 nsh scripts with "Allow run with no targets" checked and I do not face this issue there.
Thanks,
Parag -
3. Re: blcli Email sendMailWithAttachment not working correctly
Bill RobinsonNov 1, 2019 11:24 AM (in response to Parag Desai)
can you attach the job run log w/ the set -x output ?
-
4. Re: blcli Email sendMailWithAttachment not working correctly
Bill RobinsonNov 1, 2019 11:24 AM (in response to Bill Robinson)
oh - 'type 1'... yeah - that's going to create one instance of the script run for each target. if you want to loop use type 2.
-
5. Re: blcli Email sendMailWithAttachment not working correctly
Parag Desai Nov 1, 2019 11:34 AM (in response to Bill Robinson)I have tried that, but Type 2 for 10k + targets fails with some error (I think some resource issues, I will try get that error message for you though).
Type 2 works good only for some hundred odd targets only.
Thanks,
Parag -
6. Re: blcli Email sendMailWithAttachment not working correctly
Bill RobinsonNov 1, 2019 2:46 PM (in response to Parag Desai)
1 of 1 people found this helpfulif you use the %h, you might be overwhelming ARG_MAX in the shell if the list of servers (characters) is too large. %f ( a file w/ the list of targets ) might be better. but it's gonna be really slow.
you might need to break this into two jobs and a batch job.
a type 1 to gather everything
a type 2 to concatenate the results into a single file (you don't want to be concurrently appending the file w/ the type 1, that will lead to data loss) and then send the email
-
7. Re: blcli Email sendMailWithAttachment not working correctly
Parag Desai Nov 4, 2019 6:38 AM (in response to Bill Robinson)Thanks Bill. Yep you are right, concurrently appending to a file results in data loss in type 1.
I have created a batch job as suggested by you and that helps.
However, one minor block I am facing is, I cannot create an Execution Task for the batch job as I have selected the option of targets from individual jobs. One member job is of type 1 and the other is of type 2.
My use case is I need my colleague with 'non-BLAdmins' role to run my job whenever he wants. Is there an option for this?
Regards,
Parag
-
8. Re: blcli Email sendMailWithAttachment not working correctly
Bill RobinsonNov 5, 2019 11:42 AM (in response to Parag Desai)
My use case is I need my colleague with 'non-BLAdmins' role to run my job whenever he wants. Is there an option for this?
ok, so let him run the job? why do you need an execution task ?