Windows system >> Windowsの知識 >  >> Linuxシステムチュートリアル >> Linuxについて >> リモートバックアップ/リカバリ方法用のLinux iptables

リモートバックアップ/リカバリ方法用のLinux iptables

  

Linuxpシステムでは、バックアップまたはリカバリを実行するためにitablesコマンドを使用できますが、多くのユーザーはそれに慣れていません。 。
ログイン

以下のよう

1、iptablesの設定ファイルの場所:の/etc /のsysconfig /iptablesの

マスタ:マシンを実行している、すなわち、ビジネス、バックアップマシン:メインコントロールマシンに障害が発生した場合は、バックアップマシンに切り替えます。

- メインコントローラの操作-------------------

2、ディレクトリを作成します。

mkdir -p /bak /iptables /

mkdir /root /script /

3、/root /script /ディレクトリにスクリプトを作成します。

vi backup.sh

\\ cp /etc /sysconfig /iptables /bak /iptables /iptables _ $(日付+%Y%m%d%H)

4、カスタム自動タスク:

crontab -e

* /10 * * * * /usr /sbin /ntpdate 210.72.145.44

10 * * * Sh /root/script/backup.sh

- バックアップマシンの操作---------------------

5、ディレクトリを作成します。

mkdir -p /bak /iptables /{lt、yd} #ltディレクトリにUnicomジャンプのバックアップを置き、ydディレクトリにモバイルジャンプのバックアップを置きます。

mkdir /root //root /script /ディレクトリにあるScript /

6スクリプトを作成します。

vi scp_lt.sh

#!/usr /bin /expect -f

パスワードの設定gst

spawn scp -P 22 root @ 202.105.135.52:/etc /sysconfig /iptables /bak /iptables /lt /iptables

タイムアウトの設定300

に" [email protected]のパスワードが必要です:<

タイムアウト設定300

送信$パスワード\\ r"

タイムアウト設定300

送信&終了\\ r"

expect前のページ12次のページ合計2ページ

Copyright © Windowsの知識 All Rights Reserved