How to kill all screens that has been up longer then 3 weeks?
- by Darkmage
Im creating a script that i am executing every night at 03.00 that will kill all screens that has been running longer than 3 weeks.
anyone done anything similar that can help? If you got a script or suggestion to a better method please help by posting :)
I was thinking maybe somthing like this.
First do a dump to textfile
ps -U username -ef | grep SCREEN dump.txt
then do a loop running through all lines of dump.txt with a regex and putting pid of the prosseses with STIME 3weeksago in a array.
then do a kill loop on the array result.