The JSON-RPC interface can be used to query the balance and send it. Try something similar to this.. this will also start bitcoind if it's not running already. You can run this every few hours from cron.
#!/bin/bash
NICE=/bin/nice
BITCOIN=/home/solar/bitcoin/bitcoind
ADDR=1XPTgDRhN8RFnzniWCddobD9iKZatrvH4
NODE=192.75.207.66
date
${BITCOIN} getbalance 2>&1 | while read balance;
do
if [ "${balance}" == "0.000000000000000" ];
then
echo "zero balance";
elif [ "${balance}" == "error: couldn't connect to server" ];
then
echo "server not running, starting...";
${NICE} -n 19 ${BITCOIN} -daemon -addnode=${NODE}
else
echo "sending ${balance} BTC to ${ADDR}"
${BITCOIN} sendtoaddress ${ADDR} ${balance};
fi
done