Thursday, March 15, 2012

Cron running job / script every 5 second

crontab -e

add this on your crontab

*/1 * * * * /scripts/5secondrotatorscript.sh

#! /bin/bash
LOGFILE=/root/username/logs/log_`date +%H%M%S`.log

x=60
while [ ${x} -gt 0 ]
do
/usr/bin/php /home/username/public_html/scripts/file.php >> $LOGFILE
x=$((x-5))
sleep 5
done

save as 5secondrotatorscript.sh

No comments: