Note: I did consider putting this question on the AskUbuntu site, but believe it is a scripting/programming question at its core, and thus deserves to be here on SO.
I'm trying to use upstart to run a script every time I turn my Ubuntu desktop on. Specifically, I want to ping my router every 30 seconds (for reasons outside the scope of this question).
I read the upstart tutorial and also read up on a few example articles from around the internet. I am planning on writing and saving the script to a file called /etc/init/heartbeat.conf
, which I believe is the correct location and file extension for upstart scripts (please correct me if I'm wrong).
Here is the contents of that script (which I have hacked together from various tutorials/examples online):
start on started network-manager
script
ping -i 30 192.168.1.1 | cat >> ~/heartbeat/ping.log
end script
When I start my machine, I don't get any GUI/gnome-related errors, and don't see anything in /var/log/syslog
, but I also don't see any ping
output in ~/heartbeat/ping.log
. Where am I going astray? Thanks in advance!