Kind of a newbie to bash, sorry.
I wanted to generate a script to enter all directories under current_directory with "bifn*0.2e" in the name and then automatically delete files every minute with "acc" in the name. These are continuously being generated by another process. This is what I have and it seems to work.
#!/bin/bash while true do find /current_directory/bifn*0.2e* -name '*acc*' -mmin +1 -delete sleep 60 done
However, after I ran the script ./auto_remove, I did a Ctrl+Z and
bg to keep it in the background running. I wanted this script to continue removing files even after I exit the terminal. That part works too. But now I cannot kill what it is doing, nor do I see evidence the script is going (except that the acc files are being removed!). I have tried typing
ps fjx or
jobs. I have also tried re-running the script with the find line commented out.
So, please help me to stop what it is doing! And, for future use, how can I more elegantly do what I want to do while being able to terminate it when needed?