scsd-configs/code/run_backup_mx.sh
2025-08-12 14:56:38 -04:00

15 lines
514 B
Bash
Executable File

#!/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