I suggest the use of rsync over ssh if you're having network and connection problems. That way, you can pick up where you left off should the connection drop during transfer. Yes, it's another piece of software, but you can avoid having to create custom shell scripts or sftp batch files.