Run shell command multiple times with given interval