title: Writing startup script for Ubuntu
body: <p><strong>Note</strong>: I did consider putting this question on the <a href="https://askubuntu.com/">AskUbuntu</a> site, but believe it is a scripting/programming question at its core, and thus deserves to be here on SO.</p>
  
  <p>I'm trying to use <a href="http://upstart.ubuntu.com/" rel="nofollow noreferrer">upstart</a> 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).</p>
  
  <p>I read the <a href="http://upstart.ubuntu.com/getting-started.html" rel="nofollow noreferrer">upstart tutorial</a> 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 <code>/etc/init/heartbeat.conf</code>, which I <em>believe</em> is the correct location and file extension for upstart scripts (please correct me if I'm wrong).</p>
  
  <p>Here is the contents of that script (which I have hacked together from various tutorials/examples online):</p>
  
  <pre><code>start on started network-manager
  script
      ping -i 30 192.168.1.1 | cat &gt;&gt; ~/heartbeat/ping.log
  end script
  </code></pre>
  
  <p>When I start my machine, I don't get any GUI/gnome-related errors, and don't see anything in <code>/var/log/syslog</code>, but I also don't see any <code>ping</code> output in <code>~/heartbeat/ping.log</code>. Where am I going astray? Thanks in advance!</p>