Here's a little python program I wrote that checks to see if you have a bitcoin balance and, if so, sends it to a stored address. I use it with a cron job on my headless Bitcoin generating box to keep my main wallet fed with coins.
#!/usr/bin/python
import subprocess,sys
MyBCAddress = 'PUT YOUR BITCOIN ADDRESS HERE'
p = subprocess.Popen(['bitcoin','getbalance'],stdout=subprocess.PIPE)
out,err = p.communicate()
out = out.strip()
try:
bal = float(out)
except ValueError:
sys.exit(1)
if bal > 0.01:
print "We have a balance of {0:.2f}BC. Sending...".format(bal)
p = subprocess.Popen(['bitcoin','sendtoaddress',MyBCAddress,str(bal)],stdout=subprocess.PIPE)
out,err = p.communicate()
print out
else:
print "No coins here."