Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
Ubuntu supports upstart, I guess you could monitor and keep your bitcoind process running with this. –  Max Min Mar 8 '13 at 9:14

1 Answer 1

Upstart 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.