/cistromescripts/kill_processes_over_1day.sh
https://bitbucket.org/cistrome/cistrome-harvard/ · Shell · 13 lines · 5 code · 4 blank · 4 comment · 1 complexity · 9a1a9c619d746b4f162fd316fd035f45 MD5 · raw file
- #!/bin/bash
- # the account the cistrome server runs on in *nix system.
- CISTROMEAP_ACCOUNT=cistromeap
- # this command return the processed run by cistromeap, sorted by
- # elapsed time after the job is started.
- ps --sort etime -u ${CISTROMEAP_ACCOUNT} -o etime=,pid=,args | grep -v paster.py | perl -ne 'print if /\-\d\d\:\d\d\:\d\d/' | perl -ane 'print $F[1],"\n"' > ps_jobs1day.txt
- while read i;do kill -9 $i;done < ps_jobs1day.txt
- echo "Killed by ",`date`
- cat /data/CistromeAP/galaxy-dist/ps_jobs1day.txt