crontab -e
# insert his:

# to timesync every 1 minutes
* * * * * /srv/www/scripts/poll_every_3_seconds.sh

vim /srv/www/scripts/poll_every_3_seconds.sh
# insert this:

for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
        /srv/www/scripts/poll_every_3_seconds.php ;
        sleep 3 ;
        echo $i >> /srv/www/scripts/poll_every_3_seconds.log;
done

# if you need it every second, do it like this:

for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
do
        /srv/www/scripts/poll_every_3_seconds.php ;
        sleep 1 ;
        echo $i >> /srv/www/scripts/poll_every_3_seconds.log;
done

# the .php file looks like this: (modify path to your php-cgi binary)

vim /srv/www/scripts/poll_every_3_seconds.php
# insert:

#!/usr/bin/php-cgi
<?php
echo "Hello World!";
?>
admin