Openwrt automatic backup to another host

1. Что нужно перед началом
У нас есть машина (хост с бекапами) на которую мы хотим складывать бекап конфигурации openwrt на постоянной основе в кроне.
Мы будем выполнять  команду удаленно на openwrt  с хоста с бекапами через ssh поэтому нужно сделать вход без пароля по ключу
Смотрим ключ на хосте с бекапами

cat /home/user/.ssh/id_rsa.pub
Копируем содержимое и выставляем в openwrt в веб интерфейсе, так как команда ssh-copy-id у меня почемуто не сработала

В веб интрефейсе System-Administration-SSH Keys, вставляем одной строкой и Save and Apply

Проверяем из терминала хоста с бекапами вывполнение команды на openwrt

ssh root@192.168.10.1 'uptime'

Должны без запроса пароля увидеть uptime наopenwrt

Теперь запускам генерацию бекапа конфигурации на openwrt Оригинал статьи откуда взята команда

ssh root@192.168.10.1 'sysupgrade --create-backup /tmp/backup-`cat /proc/sys/kernel/hostname`-`date +%Y-%m-%d-%H%M%S`.tar.gz'

и Проверяем что файл сгенерировался

ssh root@192.168.10.1 'ls /tmp/backup*'
Теперь копируем файл с openwrt в папку на хост с бекапами

scp root@192.168.10.1:/tmp/backup* /Path_to_folder_on_host_with_backups

Проверяем что он скопировался на хост с бекапами

ls -la /Path_to_folder_on_host_with_backups

и удаляем бекап с роутера openwrt

ssh root@192.168.10.1 'rm /tmp/backup*'

Проверяем что он удалился

ssh root@192.168.10.1 'ls /tmp | grep backup'

 

Теперь когда мы сделали все руками можем добавить в крон

ssh root@192.168.10.1 'sysupgrade --create-backup /tmp/backup-`cat /proc/sys/kernel/hostname`-`date +%Y-%m-%d-%H%M%S`.tar.gz' && scp root@192.168.10.1:/tmp/backup* /Path_to_folder_on_host_with_backups && ssh root@192.168.10.1 'rm /tmp/backup*'
Статья не закончена.... Что сделать:
Можем написать скрипт в который  мы будем передавать переменными айпи адреса всех роутеров которые нужно забекапить
Сделать Удаление стрых бекапов, то есть держать на машине определенное количество, к примеру 30 штук.
Добавить отправку на почту результата

Таксаномия: 

Комментарии

cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap yeezy shoes Cheap yeezys air jordans for sale cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordan 12 cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordan 12 cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordans For Sale cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordans For Sale cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordans Men cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordans Online cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Jordans Shoes cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Puma Shoes cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Real Yeezys cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Under Armour Shoes cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Under Armour Shoes cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Yeezy Boost 350 v2 cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Cheap Yeezy v2 cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Jordans For Cheap cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys Jordan Shoes Cheap cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap air jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap adidas shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap curry shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap fake yeezys cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan 11 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordans for sale cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap kobes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap lebron shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap nike shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap nike shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap real jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap real jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap real jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd jordans cheap cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd lebron 12 cheap cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap adidas nmd cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap air force ones cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap air max 90 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordan shoes for men cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap jordans online cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap kd shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap kobe shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap lebron 13 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap lebrons cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap nike air max shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap nike roshe cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap retro jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap ultra boost cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap under armour cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap retro jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap yeezys 350 cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd cheap yeezys for sale cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd discount jordans cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd jordans for cheap cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd nike roshe run cheap cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd off white cheap cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes cheap jordans cheap yeezy shoes Cheap yeezys cheap nmd wholesale nike shoes cheap yeezy boost 350 cheap nike air max cheap nike shoes cheap lebrons cheap jordan shoes http://www.topsneakerwholesale.com/ http://www.adidasultraboost.uk/ http://www.adidasyeezy.us.org/ http://www.cheapsnapbackhats.us.com/ http://www.cheapyeezys.fr/ http://www.yeezysboost350.fr/ http://www.adidasyeezy.uk/ http://www.soronshop.com/ http://www.cheapairmax2018.co.uk/ http://www.dearlover.us/ http://www.kickstmall.com/ http://www.adidasultraboost.fr/ http://www.adidasyeezy.fr/ http://www.adidasyeezy350boost.uk/ http://www.adidasyeezy350boost.us.org/ http://www.cheapyeezy350boost.us/ http://www.yeezy350boost.uk.com/ http://www.yeezyboost350.fr/ http://www.yeezyboost350.com.de/ http://www.yeezyboost350forsale.co.uk/ http://www.yeezyboost350forsale.us.org/ http://www.yeezyboost.me.uk/ http://www.yeezyshoes.it/ http://www.yeezyshoes.me.uk/ http://www.airjordansforsale.us.com/ http://www.cheapjordan12.us.com/ http://www.cheapjordans.org/ http://www.cheapjordansforsale.co.uk/ http://www.cheapjordanshoes.org/ http://www.cheapjordansmen.us.com/ http://www.cheapjordansonline.us.org/ http://www.cheapjordansshoes.us.org/ http://www.cheappumashoes.us.com/ http://www.cheaprealyeezys.us.com/ http://www.cheapunderarmourshoes.com/ http://www.cheapyeezyboost350v2.us.com/ http://www.cheapyeezyv2.com/ http://www.jordansforcheap.us.org/ http://www.jordanshoescheap.us.org/ http://www.cheapairjordans.us.org/ http://www.cheapadidasshoes.us.com/ http://www.cheapcurryshoes.us.com/ http://www.cheapfakeyeezys.com/ http://www.cheapjordan11.us.com/ http://www.cheapjordansforsale.us.org/ http://www.cheapjordanshoes.us.org/ http://www.cheapkobes.us.com/ http://www.cheaplebronshoes.us.com/ http://www.cheapnikeshoes.us.org/ http://www.cheapnmd.com/ http://www.cheaprealjordans.us.org/ http://www.cheapyeezys.us.org/ http://www.cheapyeezyshoes.us.com/ http://www.jordanscheap.us.org/ http://www.lebron12cheap.com/ http://www.cheapadidasnmd.us.org/ http://www.cheapairforceones.us.com/ http://www.cheapairmax90.us.org/ http://www.cheapjordanshoesformen.us.com/ http://www.cheapjordansonline.co.uk/ http://www.cheapkdshoes.us.com/ http://www.cheapkobeshoes.us.com/ http://www.cheaplebron13.us.com/ http://www.cheaplebrons.us.com/ http://www.cheapnikeairmaxshoes.us.com/ http://www.cheapnikeroshe.us.com/ http://www.cheapretrojordans.us.org/ http://www.cheapultraboost.us.com/ http://www.cheapunderarmour.us.com/ http://www.cheapyeezyboost350.com/ http://www.cheapyeezys350.com/ http://www.cheapyeezysforsale.us.com/ http://www.discountjordans.us.com/ http://www.jordansforcheap.co.uk/ http://www.nikerosheruncheap.com/ http://www.offwhitecheap.com/ http://www.wholesalenikeshoes.us.com/

Добавить комментарий