Author

Topic: Way to fire up Bitcoin-QT once a week to sync blocks, then quit? (Read 1641 times)

full member
Activity: 168
Merit: 100
lol yeah. OP will spend 6 weeks researching and testing this when it could easily be done with a few clicks.

Automating things means you don't have to remember, and means you can schedule it to take place when you normally aren't doing other things. And automating probably means he can do with bitcoind instead of bitcoin-qt
full member
Activity: 196
Merit: 100
lol yeah. OP will spend 6 weeks researching and testing this when it could easily be done with a few clicks.

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.
Even this is much more complicated then it needs to be. The OP can simply open bitcoin QT and close it once it has synched the blockchain. This would take no more then a total of 30 seconds of the OP's time every week.
legendary
Activity: 1806
Merit: 1003
Same as on any OS, use the task scheduler for your OS, to start bitcoin-qt, wait 2-3 hours, then shut it down.

legendary
Activity: 1610
Merit: 1000
Well hello there!
Use Cocktail to schedule regular startup's with shutdown's issued after whatever time period is reasonable given how often you update your wallet and the speed with which your system/connection does it.
sr. member
Activity: 644
Merit: 260
The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.
Even this is much more complicated then it needs to be. The OP can simply open bitcoin QT and close it once it has synched the blockchain. This would take no more then a total of 30 seconds of the OP's time every week.
full member
Activity: 168
Merit: 100
The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.

They call it something else but the user crontab command is still there and it still reads a standard crontab file.

At least on whatever version of OS X my mum has.
cp1
hero member
Activity: 616
Merit: 500
Stop using branwallets
The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.

Yeah, just do whatever cron is called on mac with two jobs, one to start and one to stop.
sr. member
Activity: 399
Merit: 257
Hey all,

I'm not very much involved with Bitcoin anymore, but I do still do minor amounts of mining, and occasionally do micropayments.  Ergo, I'd like to maybe once a week, once a month spin up my client just to synchronize blocks (so if I *do* need to use it, it's current), and shut down.

I'm on mac, for what it's worth.

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.  What I'm really looking for is something more like "run until synchronized, OR for a maximum of N hours".

Is there a better way that I'm missing?  Is this/should this be a feature request?

I'm a little confused about what you actually want to do. You can just set automated tasks on your Mac to launch the client and shutdown your computer if that's all you really need. Isn't Automator available for the version of Mac OS that you're using?
sr. member
Activity: 644
Merit: 260
Every Sunday you can simply open QT via the spotlight, let it run while you do your thing on your computer, checking every two hours or so and when you see the green check that shows it is fully synced you can press "apple" + "Q" to close it.

It could not be more simple then this
legendary
Activity: 1974
Merit: 1029
The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.

If you're going to run bitcoin at 3am, why not do it daily? You can let it run for 2-3 hours, then issue a 'bitcoin-cli stop' and you'll always have the chain pretty much updated.
member
Activity: 96
Merit: 10
esotericnonsense
You said you didn't want to mess with the API, but in case you do, it should not be that difficult to make up a script that can achieve this.

Start up bitcoin-qt.

Using JSON-RPC, poll it for latest block every now and then ('getbestblockhash', 'getblock').
Assume you are synced when the 'time' field is within say 12 hours of your system time.
Using JSON-RPC, send 'stop' request.

A cron job with a bash script (does mac have equivalents?) seems capable of doing it.
newbie
Activity: 1
Merit: 0
Hey all,

I'm not very much involved with Bitcoin anymore, but I do still do minor amounts of mining, and occasionally do micropayments.  Ergo, I'd like to maybe once a week, once a month spin up my client just to synchronize blocks (so if I *do* need to use it, it's current), and shut down.

I'm on mac, for what it's worth.

The --help seems to imply there's no way to quit automatically, and without messing with the JSON API and whatnot, I suppose the easiest way is to start up at 3am, run for a few hours, then send a kill to the PID file, but that feels dirty.  What I'm really looking for is something more like "run until synchronized, OR for a maximum of N hours".

Is there a better way that I'm missing?  Is this/should this be a feature request?
Jump to: