diff --git a/code/central_devices.py b/code/central_devices.py index 68dbd89..d9a0e0c 100644 --- a/code/central_devices.py +++ b/code/central_devices.py @@ -17,7 +17,7 @@ all: ansible_aoscx_validate_certs: False ansible_aoscx_use_proxy: False ansible_acx_no_proxy: True - ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + ansible_ssh_common_args: "-o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" """ diff --git a/code/run_backup_configs.sh b/code/run_backup_configs.sh index c327737..07c6a38 100755 --- a/code/run_backup_configs.sh +++ b/code/run_backup_configs.sh @@ -8,6 +8,6 @@ done ansible-playbook -e "ansible_user=$USERNAME" -e "ansible_password=$PASSWORD" -i inventory.yml backup_configs.yml #ansible-playbook -e "ansible_user=$DFLT_USERNAME ansible_password=$DFLT_PASSWORD" -i inventory.yml -l @backup_configs.retry backup_configs.yml -run_backup_wlcs.sh +/work/run_backup_mx.sh chown -R 1000:1000 /configs/ diff --git a/code/run_backup_mx.sh b/code/run_backup_mx.sh new file mode 100755 index 0000000..a80175b --- /dev/null +++ b/code/run_backup_mx.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +ssh -i ~/.ssh/id-rsa -o PreferredAuthentications=publickey johnp@192.168.1.9 "show configuration | display set " >/tmp/noc-jmx-104-b.set +ssh -i ~/.ssh/id-rsa -o PreferredAuthentications=publickey johnp@192.168.1.10 "show configuration | display set" >/tmp/noc-jmx-104-a.set +for fn in noc-jmx-104-a.set noc-jmx-104-b.set ; do + + size=$(stat -c %s /tmp/$fn) + if (( $size > 0 ));then + mv /tmp/$fn /configs/mx + else + rm /tmp/$fn + fi + +done