You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
# сохранение настроек со всех коммутаторов, данные берутся из файла backup.ip
# при запуске с ключом --update этот файл обновляется
# берутся коммутаторы из базы, обновленные не позднее $update_days
# предполагается, что все файлы лежат в локальном git репозитории $git_dir
# все файлы ищем относительно директории запуска файла
basedir=$(dirname $(realpath $0))
# библиотека функций для работы с коммутаторами
source $basedir/sw_functions.sh
# общие функции и константы
source $basedir/common.sh
backup_file=$basedir/config/ip/backup.ip
update_days=2
if [[ ("$#" > 0) && ($1 == "--update") ]]; then
echo "SELECT INET_NTOA (ip_address) AS ip FROM switches WHERE datediff(now(), last_update) < $update_days ORDER BY last_update ASC;" | mysql -u sw sw_info | tail -n +2 > $backup_file