{
echo "=================== Start Backup Now: `date` ===================================="
service tomcat stop
service mysqld stop
rsync -av --delete 131.1.2.216:/home/jira-3.12.3 /home/
rsync -av --delete 131.1.2.216:/home/confluence-2.9 /home/
rsync -av --delete 131.1.2.216:/home/tomcat /home
rsync -av --delete 131.1.2.216:/home/jdk1.6.0_07 /home
now=`date +%Y%m%d%H%M%S`
mkdir -p /home/backup/db/$now
rsync -av --delete 131.1.2.216:/var/lib/mysql /var/lib
rsync -a --delete /var/lib/mysql /home/backup/db/$now # backup also here
rsync -av --delete 131.1.2.216:/etc/init.d/tomcat /etc/init.d
rsync -av --delete 131.1.2.212:/home/svn /home
rsync -av --delete 131.1.2.212:/etc/httpd/conf/httpd.conf /etc/httpd/conf
rsync -av --delete /etc/httpd/conf/httpd.conf /home/backup/scripts
# backup cvs
rsync -av --delete 131.1.2.234:/cvs /home
service mysqld start
service tomcat start
echo "=================== End Backup Now: `date` ===================================="
echo ""
} 2>&1 | tee -a /home/backup/backup.log
备份jira,wiki,svn
自动ssh-key:
SSH 自动登录设置
1、在客户端运行ssh-keygen命令,缺省的回车回车,最后,在当前用户~/.ssh目录下会生产一个id_rsa.pub文件
2、在要访问的服务器的用户的.ssh目录下,将id_rsa.pub文件内容复制到~/.ssh/authorized_keys文件中,每个客户端1行。
3、使用ssh -l username server 进行测试,如果不需要输入密码,则表示配置成功