1844011 Members
2905 Online
110226 Solutions
New Discussion

Proper use of CTRL + C

 
lisa_10
Occasional Contributor

Proper use of CTRL + C

Hallo all,
what happens if I run a script which contains the fbackup command and then I use CTRL+C 'cause I want to stop the fbackup?
Do I stop the fbackup command or do I act on the script's shell?
I mean, if I act on the shell do I stop the command in the proper way?
Thanks,
Lisa
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor

Re: Proper use of CTRL + C

Hi Lise:

If you didn't run the 'fbackup' as a background job with 'nohup' then it is killed when the parent (shell) is killed.

Regards!

...JRF...
Alexander M. Ermes
Honored Contributor

Re: Proper use of CTRL + C

Hi there.
You act on the script.
If you add this line

set -x

you will output on your screen, what your script is just doing. You then can see, where your CTRL+C stops the script.
If you wnat to stop everything, you should do it with

ps -ef |grep scriptname
after that
ps -ef |grep process# of script

you will see all processes, depending on the script. If you see your fbackup, do a kill on all processes depending on the script including the fbackup.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"