./apachectl -t
./apachectl graceful
即可不中断业务加载配置
su - oracle
sqlplus
user
pwd
将本地文件复制到目标机器:
scp 文件名 用户名@目标机器IP:目标机器路径
scp /arrayfs/xxx.dmp root@192.168.xx.xx:/opt/db_bak/
将目标机器的文件复制到本地
scp 用户名@目标机器IP:目标机器文件名 本地路径
scp root@192.168.xx.xx:/arrayfs/xxx.dmp /opt/db_bak/
rsync -zvrtopg -progress -e 'ssh -p 端口号' root@192.xx.xx.xx:/文件目录/ 本机的目录地址
rsync -zvrtopg -progress -e 'ssh -p 22' root@192.168.xxx.xxx:/nfs100/b2b_resources/ /nfs100/b2b_resources/
crontab -e
exp xxx/xxx@xxxfile=xxx.dmp owner=(xxx);
imp xxx/xxx@xxxfile=/opt/xxx.dmp show=n buffer=2048000 ignore=y grants=y full=y;
压缩文件:
tar -zcvf 2014-03-27_webapp.tar.gz webapp
查看日志
tail -f /opt/apache-tomcat-6.0.32/logs/catalina.out
mount -t nfs -o rw 192.168.xxx.xxx:/nfs100 /arrayfs
Tomcat重启脚本:
#!/bin/bash
cd /opt/
kill -9 `ps aux | grep "java" | grep "xxx" | awk '{print $2}'`
cd /opt/apache-tomcat-xxx/bin/
rm -rf ../work/Catalina/
nohup ./startup.sh &
tail -f ../logs/catalina.out
# 每天凌晨8点自动重启
0 8 * * * /opt/restart_xxx.sh > /dev/null 2 & > 1
0 8 * * * /opt/restart_xxx.sh > /dev/null 2 & > 1
Oracle数据库自动备份-xxx.sh:
export ORACLE_BASE=/home/oracle/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export date=`date +%Y%m%d`
$ORACLE_HOME/bin/exp 用户名/密码@实例 file=/opt/dbback/xxxx_$date.dmp log=/opt/dbback/xxx_$date.log owner=xxx compress=y direct=y feedback=10000 buffer=10000000