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!
If 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.
Not a bioinfo Q. Still, this might help you https://stackoverflow.com/questions/17385794/how-to-get-the-process-id-to-kill-a-nohup-process
You're killing the wrong bash process.
Do
ps -ef | grep all_bacteria_links
and kill the right process.Pro tip: use a decoy character class with the
grep
following theps
to avoid listing thegrep
as one of the candidates.The pattern
[a]ll
doesn't match the string"[a]ll"
, so thegrep
process won't be picked.OP has a very convoluted way to run the command by running a bash shell with nohup, so the process to kill is bash.
I believe there is a specific corner in hell for people who do this, no?
It 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!