Kill Nohup Bash Process - Biostars
Maybe your like
Kill nohup bash process 0 Entering edit mode Hey guys,
I ran this
nohup bash -c 'for next in $(cat all_bacteria_links.txt); do wget -P all_bacteria "$next"/*genomic.fna.gz; done',and now I want to kill the process. I ran the command in ssh server, so whenever I try to kill PID or kill -9 PID, the server connection closes. Can you please let me know how I can kill this process? Thanks!
genome sequence • 10k views ADD COMMENT • link updated 6.7 years ago by Santosh Anand 5.8k • written 6.7 years ago by genomes_and_MGEs ▴ 10 1 Entering edit modeNot a bioinfo Q. Still, this might help you https://stackoverflow.com/questions/17385794/how-to-get-the-process-id-to-kill-a-nohup-process
ADD REPLY • link 6.7 years ago by Santosh Anand 5.8k 0 Entering edit modeYou're killing the wrong bash process.
ADD REPLY • link 6.7 years ago by Devon Ryan 105k 0 Entering edit modeDo ps -ef | grep all_bacteria_links and kill the right process.
ADD REPLY • link 6.7 years ago by WouterDeCoster 48k 2 Entering edit modePro tip: use a decoy character class with the grep following the ps to avoid listing the grep as one of the candidates.
ps -ef | grep "[a]ll_bacteria_links"The pattern [a]ll doesn't match the string "[a]ll", so the grep process won't be picked.
ADD REPLY • link 6.7 years ago by Ram 45k 1 Entering edit modeOP has a very convoluted way to run the command by running a bash shell with nohup, so the process to kill is bash.
ADD REPLY • link 6.7 years ago by Santosh Anand 5.8k 2 Entering edit modeI believe there is a specific corner in hell for people who do this, no?
ADD REPLY • link 6.7 years ago by WouterDeCoster 48k 0 Entering edit modeIt doesn't work, because the PID is always changing on the server... So, I found a solution:
pkill -STOP -P the_ppid
Thanks anyway guys!
ADD REPLY • link 6.7 years ago by genomes_and_MGEs ▴ 10 8 Entering edit modeHi, I'd recommend using screen instead of nohup, screen is safer.
And, you better utilize some batch commands like parallel to accelerate thousands of jobs, here is wget.
Using wget -c to resume unfinished download is also recommended.
Here's my method in this case from Manipulation on NCBI refseq bacterial assembly summary
$ cat mt.tsv | csvtk cut -t -f ftp_path | sed 1d \ | rush -v prefix='{}/{%}' \ ' wget -c {prefix}_genomic.fna.gz; \ wget -c {prefix}_genomic.gbff.gz; \ wget -c {prefix}_genomic.gff.gz; \ wget -c {prefix}_cds_from_genomic.fna.gz \ wget -c {prefix}_protein.faa.gz; \ ' \ -j 10 -c -C download.rushIf the process died for some reasons like PC reboot or network interrupt, just re-run the command, which will ignore finished jobs recorded in file download.rush.
ADD COMMENT • link 6.7 years ago by shenwei356 8.7k 0 Entering edit modeTHIS is the right solution!
ADD REPLY • link 6.7 years ago by Santosh Anand 5.8kLogin before adding your answer.
Similar Posts Loading Similar Posts Traffic: 4654 users visited in the last hour Content Search Users Tags Badges Help About FAQ Access RSS API StatsUse of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by theTag » How To Stop Nohup Process
-
How To Get The Process ID To Kill A Nohup Process? - Stack Overflow
-
How To Stop Nohup Which Is Working Background
-
Can Not Stop Nohup Process - Unix & Linux Stack Exchange
-
Getting The PID Of A Nohup Process | Baeldung On Linux
-
How To Stop The Nohup Command - Quora
-
How To Get The Process ID To Kill A Nohup Process? - SyntaxFix
-
08-D.9.6: Process Troubleshooting - Nohup And Kill Commands
-
Terminate A Processed Launched By Nohup - Server Fault
-
Linux Nohup Command/Signal Tutorial - LinuxTect
-
How To Get The Process ID To Kill A Nohup Process?
-
Nohup Command In Linux - DigitalOcean
-
Trying To Kill A Nohup Process That Changes Pids - ADocLib
-
Ctrl-C Kills Nohup Background Processes - Help Doco
-
How To Kill Process In Linux & Terminate A Process In UNIX - NixCraft