650) this.width=650; "title=" Backup server. jpg "alt=" wkiol1uekpdxoxg1aad_i46aoda854.jpg "src=" http://s3.51cto.com/ Wyfs02/m00/5c/97/wkiol1uekpdxoxg1aad_i46aoda854.jpg "/>
[Email protected] 192.168.1.20]# cat/server/scripts/beifen.sh
#!/bin/sh
ip=$ (Ifconfig |awk-f ' [:]+ ' nr==2 {print $4} ')
Path= "/backup/$IP"
[!-D $Path] && mkdir $Path-P
mubiao= "/app"
#backup
Tar zcf $Path/www_$ (date +%f). TAR.GZ/APPLICATION/HTTPD &&\
Tar zcf $Path/conf_$ (date +%f). Tar.gz/var/spool/cron/root/etc/rc.local/etc/sysconfig/iptables/server/scripts & &\
Tar zcf $Path/logs_$ (date +%f). tar.gz $MUBIAO &&\
find/backup/-type f-name "*$ (date +%f). tar.gz" |xargs md5sum >> $Path/flag_$ (date +%f)
#to Bak Server
rsync-avz/backup/ [email protected]:: Backup--password-file=/etc/rsync.password
#del
find/backup/-type f-name "*.tar.gz"-mtime +7 | Xargs rm-f
[Email protected] scripts]# cd/backup/
[[email protected] backup]# ls
192.168.1.20
[Email protected] backup]# CD 192.168.1.20/
[[email protected] 192.168.1.20]# ls
conf_2015-04-03.tar.gz flag_2015-04-03 logs_2015-04-03.tar.gz www_2015-04-03.tar.gz
[Email protected] 192.168.1.20]# md5sum-c flag_2015-04-03
/backup/192.168.1.20/www_2015-04-03.tar.gz:ok
/backup/192.168.1.20/logs_2015-04-03.tar.gz:ok
/backup/192.168.1.20/conf_2015-04-03.tar.gz:ok
This article from the "Clear Sky" blog, declined reprint!
Online business backup + regularly delete backup files +MD5 encryption