dont wait for script to finish
Posted: June 28th, 2017, 7:08 am
Hello every one.
For my personal usecase i need to transfer the downloded data to different nas boxes here at home.
It is possible and a performancegain to do so. Sabnzbdplus allways waits for script and (child/sub)processes to finish.
Scripts are working it gets everything done as ecxpected but i need asynchronus behavior.
does anybody know how to achive this ?
Thanks
For my personal usecase i need to transfer the downloded data to different nas boxes here at home.
It is possible and a performancegain to do so. Sabnzbdplus allways waits for script and (child/sub)processes to finish.
Scripts are working it gets everything done as ecxpected but i need asynchronus behavior.
Code: Select all
#!/bin/bash
max_thread=2
while [[ ($(pgrep -cf "/root/.dl/scripts/transfer.sh") -ge $max_thread) ]]; do
sleep 1
done
nohup /root/.dl/scripts/transfer.sh $@ & exit 0
Thanks