First, because the report server does not know what causes the service is always abnormal, service inexplicably stopped, development said may be due to code anomalies, so write a simple script and scheduled tasks, every two minutes to review the process, if not start the process, otherwise do nothing.
The script is as follows:
#!/bin/bash. /etc/profilea= ' Ps-ef | grep Tomcat-report | Grep-v grep | Wc-l ' anti-quote if ["$a"-ne 1]THEN/USR/LOCAL/TOMCAT-REPORT/BIN/STARTUP.SHFI
The scheduled tasks are as follows:
# CRONTAB-L*/2 * * * */bin/bash/usr/local/tomcat-report/bash/re.sh
Second, MySQL to remote backup, the monthly 15th 0:0 back up the library, named with a timestamp and compression.
The script is as follows:
#!/bin/bash. /etc/profilea= ' Date +%y%m%d ' mysqldump-u root-h 10.10.222.8 Cloud | gzip-9 >/data/cloud/cloud-$A. sql.gzmysqldump-u root-h 10.10.222.9 Istorm | gzip-9 >/data/istorm/istorm-$A. sql.gz
The password is written in the/ETC/MY.CNF (the machine performing the backup)
[mysqldump]user=rootpassword=123456
The scheduled tasks are as follows:
# crontab-l0 0 * */bin/bash/data/mysql.sh
This article is from the "Promise" blog, make sure to keep this source http://hatech.blog.51cto.com/8360868/1694118
Simple script + Scheduled task