<p><a href="http://upstart.ubuntu.com/" rel="nofollow">Upstart</a> is the preferred method, have it launch your mining program on boot and respawn the program if it dies.</p>

<p>Checking if it's working is another matter, it requires a more meta approach.  I would suggest you start another script that queries bitcoind via the command line, parses the response, and kills the process if it's not mining.  Upstart will see that the process is gone and spawn a new one.</p>

<p>If you run into problems (overclocked GPU's are mighty unstable!) you might even want to log the number of times you have killed it and reboot the server after X kills in Y minutes.</p>

CC BY-SA 3.0
2015-11-17T19:25:01.530Z
Ubuntu now uses [Systemd](https://wiki.ubuntu.com/SystemdForUpstartUsers).
Indolering
CC BY-SA 3.0
2013-05-13T01:25:25.177Z
2013-05-13T01:25:25.177Z
Indolering
<p>What would be the best way to start writing a script to automatically run a bitcoind server on an Ubuntu startup, make regular backups and restart from a backup on error. Would this normally be done through a cron job?</p>

CC BY-SA 3.0
2013-03-08T09:14:18.447Z
Ubuntu supports upstart, I guess you could monitor and keep your bitcoind process running with this.
Max Min
<bitcoind><ubuntu><linux><server>
How to run a bitcoin server with automatic restart and backup?
ZenBalance
# How to run a bitcoin server with automatic restart and backup?

(Asked by: username_0 on 2013-03-08)

What would be the best way to start writing a script to automatically run a bitcoind server on an Ubuntu startup, make regular backups and restart from a backup on error. Would this normally be done through a cron job?

**Tags:** bitcoind, ubuntu, linux, server

> **Comments:**
> **username_1**: Ubuntu supports upstart, I guess you could monitor and keep your bitcoind process running with this.  

---

## 1 answers

### Answer by username_2 on 2013-05-13. Score: 2

[Upstart](http://upstart.ubuntu.com/) is the preferred method, have it launch your mining program on boot and respawn the program if it dies.

Checking if it's working is another matter, it requires a more meta approach. I would suggest you start another script that queries bitcoind via the command line, parses the response, and kills the process if it's not mining. Upstart will see that the process is gone and spawn a new one.

If you run into problems (overclocked GPU's are mighty unstable!) you might even want to log the number of times you have killed it and reboot the server after X kills in Y minutes.

> **Comments:**
> **username_2**: Ubuntu now uses [Systemd](https://wiki.ubuntu.com/SystemdForUpstartUsers).  

---

