Toto je starší verze dokumentu!


ÚVOD » tajná oblast CLnet » 3comCiscoHuaweiIPv6LinuxMicrosoftNovellRouterboardVMwareostatní instalaceknihovna


04.01.2015 09:55

Zálohování

backup.sh

#!/bin/sh
 
SCRIPT=/usr/local/bin/backupsw.exp
ARCHIVE="constellium-sw-backup.tar.gz"
IP="10.163.8.11
    10.163.8.12
    10.170.2.35
    10.170.2.39"
 
rm -f /srv/tftp/*.log
for ip in $IP;
do
    echo $ip
    $SCRIPT $ip >> /srv/tftp/$ip.log
done
 
tar -zcf /tmp/$ARCHIVE /srv/tftp/*
uuencode /tmp/$ARCHIVE $ARCHIVE | mail -s "Constellium switches backup" email@email.cz
rm -f /tmp/$ARCHIVE

backupsw.exp

#!/usr/bin/expect -f
set timeout 20

# tftp server
set tftp "10.163.7.180"

# router user name
set name "atmin"

# router password
set pass "heslo"

# start telnet
spawn telnet [lindex $argv 0]

# send username and password
expect "ame:"
send "$name\r"
expect "Password:"
send "$pass\r"

expect "#"
send "copy running-config tftp://$tftp/sw-[lindex $argv 0].cfg\r"

expect "?"
send "\r"
expect "?"
send "\r"
expect "#"
cisco/skript_pro_zalohovani_konfigurace.1361952337.txt.gz · Poslední úprava: 13.03.2020 18:43 (upraveno mimo DokuWiki)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0