Forum Discussion

Suresh_Jo_32729's avatar
Suresh_Jo_32729
Icon for Nimbostratus rankNimbostratus
Aug 06, 2018

F5 Auto backup script for SCP for V12

All,

I have deployed one script in F5 for Auto backup script for SCP for V12.

Script:

!/bin/bash /admin/home/bigipbackup.sh UCS Files will be saved to /var/local/ucs/ Create current date/time stamp variable

DATETIME="

date +%Y_%m_%d
"

Note the correct ` character must be used above, this can be found near the top left of most keyboards just under the [ESCAPE] key. Uncomment the following line for troubleshooting echo $DATETIME Create filename variable

UCS_FILENAME="${DATETIME}_$HOSTNAME"

Uncomment the following line for troubleshooting echo $UCS_FILENAME Create a UCS archive with the filename specified above The file extension will be .ucs � will be available in the GUI

tmsh save sys ucs "${UCS_FILENAME}"

If you don�t delete these files /var will become full fairly quickly Change the +31 value (31 days) to whatever suits you find /var/local/ucs/ �mtime 21 -delete

scp "/var/local/ucs/${UCS_FILENAME}.ucs" abcd@1.2.3.4:/

EOF

It's asking the password for the remote server, this is defeating the automation purpose. I want that in every five minutes ucs file will generate and without any password promt it will send ucs file to the remote server.

Can someone pls tell me how this can be achieve?

7 Replies

    • Suresh_Jo_32729's avatar
      Suresh_Jo_32729
      Icon for Nimbostratus rankNimbostratus

      Thanks for sharing the docs, I tried to follow the steps mentioned in the above docs.

       

      The remote server in which I want to transfers the files is windows server and my F5 is running on linux version(Linux version 2.6.32-431.56.1.el6.)

       

      First I tried to shared the keys by command line. I got below error.

       

      cat ~/.ssh/id_rsa.pub | ssh abcd@1.2.3.4 'cat >> .ssh/authorized_keys'

      abcd@1.2.3.4's password: exec request failed on channel 0 <<<<<<

       

      Then I did scp to transfer the keys from F5 to window server.

       

      .ssh scp /root/.ssh/id_rsa.pub abcd@1.2.3.4:/ abcd@1.2.3.4's password: id_rsa.pub 100% 420 0.4KB/s 00:00

       

      It was successful but after that when I tried to run my script got same problem, password prompt.

       

      admin bash bigipbackup.sh Saving active configuration... /var/local/ucs/date_xyz.ucs.ucs is saved. abcd@1.2.3.4's password: date_xyz.ucs.ucs 100% 6677KB 6.5MB/s 00:01

       

      Any suggestion how password prompt can be avoid?

       

    • Suresh_Jo_32729's avatar
      Suresh_Jo_32729
      Icon for Nimbostratus rankNimbostratus

      Hello,

       

      Is it possible to scp (transfer) files from linux (F5) machine to the window server?

       

    • Suresh_Jo_32729's avatar
      Suresh_Jo_32729
      Icon for Nimbostratus rankNimbostratus

      Hello,

       

      Can someone pls confirm me if, Is it possible to scp (transfer) files from linux (F5) machine to the window server?