I have a basic scp sending mechanism with spawn, expect and send.
However it gets aborted during the scp transmission.
Here is the expect command:
expect -c "spawn sh -c {scp -r -P 22 /tmp/rootfs/* root@IP:/.}
expect {
password: {send \"pw12\r\"; exp_continue }
}
exit"
This gets interrupted during the scp transmission.
However if I try like this:
scp -r -P 22 /tmp/rootfs/* root@IP:/.
It will ask for the password, then I type it in, and all the files gets uploaded.
I could not dig deeper yet, what could be the problem?