How to copy a file with SCP and cronjob for a external location and cronjob – server -.
#!/usr/bin/expect -f # connect via scp spawn scp "/location/file.ext" "username@host:/location/file.ext" ####################### expect { -re ".*es.*o.*" { exp_send "yes\r" exp_continue } -re ".*sword.*" { exp_send "password\r" } } interact wait sleep 2s ls