Backup of FTP
Purpose : through Shell to upload the backed-up data to another server. FTP back up the server.
Simulation Tomcat for production data.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7D/BB/wKioL1bvOoaiyYeLAAAjXEUp800094.png "title=" 1.png " alt= "Wkiol1bvooaiyyelaaajxeup800094.png"/>
Environment:
node1:192.168.1.220 FTP Client Production Server
Node2 : 192.168.1.221ftp Service Side Backup Server
The first step: Node1 installation FTP Client
Yum Install Ftp–y
Step Two: Node2 installation FTP Service Side
Yum Install Vsftpd–y
/ETC/INIT.D/VSFTPD start
Chkconfig vsftpd on
Useradd Tomcat
Pass Tomcat (Password Tomcat )
Note: This is a simple configuration. Do is local account login, do not allow anonymous login. You can also do virtual users.
Step Three: Node1 Test
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7D/BF/wKiom1bvOhiQtHTeAABiASsHscw249.png "title=" 2.png " alt= "Wkiom1bvohiqthteaabiasshscw249.png"/>
Fourth step: in Node1 Write Shell , Upload Tomcat production data.
Mkdir/baktomcat
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7D/BF/wKiom1bvOjvi17u7AAA7DUm9rDE374.png "title=" 3.png " alt= "Wkiom1bvojvi17u7aaa7dum9rde374.png"/>
#!/bin/bash
#backup Tomcat
Bakdir=tomcat
baktime=$ (Date +%f-%h-%m-%s)
cd/usr/local/
Tar zcf/baktomcat/${bakdir}_${baktime}.tar.gz ${bakdir}
Sleep 3
Cd/baktomcat
Ftp-n <<-eof
Open 192.168.1.221
User Tomcat Tomcat
Put ${bakdir}_${baktime}.tar.gz
Bye
Eof
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7D/BB/wKioL1bvOwHxiR27AAAuCtrP4Eo216.png "title=" 4.png " alt= "Wkiol1bvowhxir27aaauctrp4eo216.png"/>
Fifth Step: FTP Backup Server View
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7D/BB/wKioL1bvOx-C91WuAADa_udCqik578.png "title=" 5.png " alt= "Wkiol1bvox-c91wuaada_udcqik578.png"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7D/BB/wKioL1bvOyzhuOxHAAAn3oQnUfo220.png "title=" 6.png " alt= "Wkiol1bvoyzhuoxhaaan3oqnufo220.png"/>
Then through the planning task, hey, you know!
If you feel good, please give the author a praise. I will write more articles and share them with you.
Enterprise's Ftp+shell+crontab Backup production data