Another method a bit more complicated, and I never tried it.
Use a TCP client with socket and connect to server using telnet. Use a thread to monitor "login:" and set user name then monitor "password:" and send password, then send the backup command, and wait for response. This way you can check the success of the backup.
I have never exactly tried this method, but I used the TCP client in a similar fashion.
Check out the "chat client / server" demo for example on how to check for the strings and send and recieve packets.