General TC > General TC Talk
Bash script help
patrikg:
And one more thing, then running scripts in terminal in background and exit the terminal will also stops the script and the programs within.
So take this as an example, if you want to download some file and you span some new terminal window and then closes that window before the download command have finished.
You have to use the nohup command to disable this behavior like tthis.
--- Code: (bash) ---nohup wget http://tinycorelinux.net/corebook.pdf &
--- End code ---
This will also make a file with the stdout from script or program goes to file nohup.out
Rich:
Hi patrikg
--- Quote from: patrikg on April 22, 2023, 12:43:10 AM ---And one more thing, then running scripts in terminal in background and exit the terminal will also stops the script and the programs within. ...
--- End quote ---
I think you are mistaken, see:
https://forum.tinycorelinux.net/index.php/topic,25999.msg166882.html#msg166882
I opened a terminal and entered:
--- Code: ---busybox wget http://tinycorelinux.net/14.x/x86/release/CorePlus-14.0.iso &
--- End code ---
I then killed the terminal. The command just got re-parented to PID 1 and ran to completion.
Whether you kill the terminal by typing exit , clicking the close button, or using the kill
command made no difference.
The GNU version of wget did not even need to be backgrounded. I ran GNU wget like this:
--- Code: ---wget http://tinycorelinux.net/14.x/x86/release/CorePlus-14.0.iso
--- End code ---
When I killed the terminal, the command still got re-parented to PID 1 and ran to completion.
MTCAT:
Hi Rich and patrikg,
Thanks a lot for the help, and the explanation, I added the ampersand to the previously last line of start_logger_TC.sh, then added a "sleep 10" followed by the taskset commands, it worked!
Now when executing the new start_logger_TC.sh we have mt_logger running on core 0 (~ 30 percent load of one core for the most part, ~ 40 percent load when the GUI is on the continuous screen though, more drawing to do), and mt_adc and gpsd running on core 1 (together taking up about 5 percent of core 1), the only other processes "floating around" across cores still (that we started up anyway) are tinierclock.sh and chrony, and they both seem to be less than 0.1 percent load,
so they seem to be just fine to move around to whichever core they want.
Thanks a lot, now on to getting some temperature readings into the program with digitemp!
David
Navigation
[0] Message Index
[*] Previous page
Go to full version