Hot search terms: 360 Security Guard Office365 360 browser WPS Office iQiyi Huawei Cloud Market Tencent Cloud Store
Programming development Storage size: 85.54MB Time: 2010-08-02
Software introduction: GCC compiler suite (GNU Compiler Collection) includes C, C++, Objective-C, Fortran, Java, Ada and Go language...
In the Linuxp system, the itables command can perform remote backup or recovery for us, but many users may not be familiar with it yet. The editor will share the method with you below.
Here's how:
1. Configuration file location of iptables: /etc/sysconfig/iptables
Main control machine: the machine that is running the business; backup machine: when the main control machine fails, it switches to the backup machine
--Operation on the main control computer------------------
2. Create a directory:
mkdir -p /bak/iptables/
mkdir /root/script/
3. Create a script in the /root/script/ directory:
vi backup.sh
cp /etc/sysconfig/iptables /bak/iptables/iptables_$(date +%Y%m%d%H)
4. Customize automatic tasks:
crontab -e
*/10 * * * * /usr/sbin/ntpdate 210.72.145.44
10 * * * * sh /root/script/backup.sh
--Operate on the backup machine---------------------
5. Create a directory:
mkdir -p /bak/iptables/{lt,yd} #The lt directory stores the backup of China Unicom jump, and the yd directory stores the backup of mobile jump.
mkdir /root/script/
6. Create a script in the /root/script/ directory:
vi scp_lt.sh
#!/usr/bin/expect -f
set password gst
spawn scp -P 22 root@202.105.135.52:/etc/sysconfig/iptables /bak/iptables/lt/iptables
set timeout 300
expect "root@202.105.135.52's password:"
set timeout 300
send "$passwordr"
set timeout 300
send "exitr"
expect eof
Okay, the above is all the content brought to you by the editor of Huajun. Isn’t it very simple? Have you learned it? If you want to know more related content, please pay attention to Huajun information at any time. Welcome to Huajun to download!
How to switch accounts to log in to iQiyi? -How to log in to iQiyi account switching account
How to capture the game with obs? -obs method of capturing games
How to set the encoder in obs? -obs method of setting the encoder
How to close and hide the OBS window in screen capture? -obs closes the method of hiding the OBS window in screen capture
How to set Traditional Chinese in obs? -obs method to set Traditional Chinese
What to do if there is no sound after reinstalling the computer system - Driver Wizard Tutorial
How to practice typing with Kingsoft Typing Guide - How to practice typing with Kingsoft Typing Guide
How to upgrade the bootcamp driver? How to upgrade the bootcamp driver
How to change QQ music skin? -QQ music skin change method
Driver President Download-How to solve the problem when downloading driver software is very slow