Trying to script as clean as possible, I wonder if there is some solution for the following situation:
One Linux server running sshd and one android device, with dropbear ssh client and rsync installed (no server).
I'm writing a script to be run remotely with a cron that backups the android memory to the linux server. The cron calls something like:
ssh remoteuser@linuxserver -i path_to_rsa_key runthisscript.sh
runthisscript.sh performs a few things with the existent data, and, what I want to do, in the middle of the script, is to rsync from the android device back to the server, taking advantage of the ssh connection that is already opened (as there is no sshd running on the android).
I've developed other solutions, like breaking my server script in several parts and calling them one after another, with the rsync (android to server direction) in the middle, but I was looking for a more elegantly implemented solution (single script, most of the work done in the server side).