Site icon Learning & Doing

Cron per detik

misal kita uat scrip bash nya di /home

nano kill.sh

#!/bin/bash
for i in `ps -ef |grep danielha|awk ‘{print $2}’`;do kill -9 $i;done

kemudian setting dic rontab per detik

* * * * * sleep 1; /bin/sh /home/kill.sh >/dev/null 2>&1 (per detik)

* * * * * sleep 10; /bin/sh /home/kill.sh >/dev/null 2>&1 (per 10 detik)

Exit mobile version