You are not logged in.
Hi to all,
I would like to create a script that once executed launches long lasting commands (every one lasts about 2 hours) and I would like to be able to terminate the main script without killing the commands which are already running.
Doing something like this:
#!/bin/bash
while true; do
longLastingCommand.sh &
sleep 3600;
done
permit me to call the longLastingCommand.sh every hour, but when I use ctrl+c to close the script, all the istances of longLastingCommand still running are immediately killed.
Can you help me please?
Last edited by Xwang (2021-03-20 08:52:09)
I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.
Offline
Use "disown" or "nohup" I guess:
Offline
Use "disown" or "nohup" I guess:
Using
nohup [command] &
is the solution.
Thank you for your help very much!
Xwang
I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.
Offline