I have a script that I have to run with certain frequency. This script executes a number of programs, in a loop, setting some variables in each loop. Since this script runs for hours, I run it using the linux "at" command, doint
at now >> ./myscript >> output
but every once a while, I've had to kill the script. What I have done is kill the PID of the programs it executes, searching them with ps -A | grep 'name'. The issue here is that since there is a loop, I can be doing this for a long time. 10 minutes just killing processes. This is not efficient.
How can I find the PID of a script launched with "at now" a few hours -or days- ago? ps -A | grep 'bash' gives no bash process that has been running for that long.
I want to kill the script, so I don't have to kill all the process launched by the loop until it finishes, but cannot find the PID.