F5 backup config script

From UVOO Tech Wiki
Revision as of 19:31, 8 April 2024 by Busk (talk | contribs) (Created page with "``` #!/bin/bash set -eu hosts=" myhost.example.com " ts=`date +%Y-%m-%d_%H-%M-%S` for host in ${hosts[@]}; do echo $host mkdir -p bkp sshpass -p ${USERPASS} ssh ${USER...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#!/bin/bash
set -eu

hosts="
myhost.example.com
"

ts=`date +%Y-%m-%d_%H-%M-%S`
for host in ${hosts[@]}; do
  echo $host
  mkdir -p bkp
  sshpass -p ${USERPASS} ssh ${USERNAME}@${host} "cd /;show running-config recursive" > bkp/$host.${ts}.config
  cp bkp/$host.${ts}.config $host.config
done