Batch run of a time-consuming script in the background #1114
-
I am trying to batch-run a time-consuming script and I am running into timeout problems. I am either getting request timeouts from the HTTP library I am using to make the requests, or I am getting a timeout error from CrowdStrike saying I checked on the target hosts and the script is properly started and runs till the end, which is the desired behaviour, but how can I make the The script that I first create and then run is this:
and I start it as follows: The script and the arguments are working fine. I tried to run the bash script in the background by adding How can I start a script on a remote host, keep it running, and just receive the information if it was properly started or not, without having to wait until it finishes? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @jkozlowicz - We could add We could also upload a script, then call it with runscript. That script could then execute, "do work" (like executing The |
Beta Was this translation helpful? Give feedback.
-
@jshcodes Looks like I was wrong... I think I wanted to recreate a script, but forgot the give it a new name and thus I thought instructions to make a process run in background were added, but in fact an old script without these was being used. I also ran into problems managing remote processes as in some cases they were dying after closing the connection with the host, which only added to the confusion. I think I have solved all the issues related to that so we can close this discussion. It seems that I am now capable of running process in background with:
|
Beta Was this translation helpful? Give feedback.
@jshcodes Looks like I was wrong...
I think I wanted to recreate a script, but forgot the give it a new name and thus I thought instructions to make a process run in background were added, but in fact an old script without these was being used. I also ran into problems managing remote processes as in some cases they were dying after closing the connection with the host, which only added to the confusion. I think I have solved all the issues related to that so we can close this discussion.
It seems that I am now capable of running process in background with:
nohup ./<my-script.sh> & disown
on linux machinesStart-Process -WindowStyle hidden "<exectuable>"
on windows machines