How to automate DUMP1090 restart command using cron?

Hey,

I have a Pi logging data from the ADSB dongle to flightaware website, works a treat 98% of the time.

Intermittently (about once every 8hrs) the localhost website showing the planes etc seems to freeze up, and I need to login to my stats page, and click the option Restart Dump1080 in order to get the pi to start logging again. I have upgraded my power supply which has not made a difference. The pi continues to work fine, the only reason I know there is a problem is when the localhost fails to load or I get the 6hr warning email from flightaware.
http://imgur.com/a/EGd2Q

I know how to setup cron tasks, and I know this should be linux101, but I have no idea how I can automate this command: sudo /etc/init.d/fadump1090.sh restart

I need to set this up to happen every 5 mins or so, that way it has minimal down time.

Cheers

Better to solve the underlying problem.

Are you exposing port 8080 to the internet? Don’t do that.

Or if you are intent on wallpapering over the cracks, at least do it by restarting dump1090 when it dies, not randomly from cron.

Yes I am exposing 8080, is that a no-no? Is it intended for local use only?

If I were to end up going down this path, can you please explain how I would go about setting this method up instead? Can I check if dump1090 is dead automatically somehow?

Cheers

It is very easy to crash the little webserver that is built in to dump1090. …just send an invalid request to it. It should return a 404 Not Found. But it doesn’t. The times I tried this, it just crashed. That is why exposing it to the external Internet (aka port forwarding an external port to 8080 ) is not recommended. Unless you need access to it from outside your home, there is no need.

Why don’t you first try shutting off the port forward and see if that stops the crashes. At least that way you can see if this is the problem.

ok will do, thanks very much for the info, I will start with that.