Forum Discussion

Kalido's avatar
Oct 13, 2021

SCP automated backup failing.

Hi Guy's,

 

 

I am following the guide https://my.f5.com/manage/s/article/K13418  to create and automatically transfer my UCS file to our remote backup.

It creates the backup but I cannot transfer it via SFTP or SCP.

I get the following when I attempt to SCP to our Windows backup server:

 

[root@REDACTED] ucs # scp -p REDACTED test@REDACTED:E:\REDACTED password:

Connection to RE.DAC.TED.X closed by remote host.

lost connection

 

I just cant get this to work, I read that I haven't done the SSH key's part because I can use the password but it won't transfer the files.

Would really appreciate the help, I am not sure how I can find or open logs to see what the issue is.

 

My linux skills are weak.

(ed. REDACTED private details)

 

2 Replies

  • you can try to use /bin/expect to execute scenario of interactive shell.
    then put the expect execution in icall, crontab or other scheduler.

    # cat /var/tmp/script.exp
    set timeout -1
    spawn $env(SHELL)
    match_max 100000
    expect "#"
    send -- "scp /var/tmp/ggg.txt myusername@myserver.com:/target/path\n"
    expect "Password:"
    send -- "mypassword\n"
    expect "# "
    send -- "exit\n"
    #
    #/bin/expect -f /var/tmp/script.exp
    ...

    you can create recording of other interactive shell flow file using "/bin/autoexpect -p"