-------------------------------------------------------------------------------------------
#! /bin/sh
#backup teh table: pmc2.offers---------------------
#get the CST time-----------------
ctime=`date -d'-8 hour ago' +%m%d`
mysqldump -uroot -p123456 --default-character-set=utf8 --opt pmc2 offers | gzip > /var/www/pmc/data/pmc2_offers_`date +%Y%m%d`.gz
#clear pmc2.offers3-----------------
mysql -uroot -p123456 pmc2 < ./sqls/pmc2_clear
#import the pmc2 qa date---------------
cd /var/www/pmc/data
mv offers_us_qa_$ctime.zip offers_us_qa_$ctime.gz
gzip -d offers_us_qa_$ctime.gz
mysql -uroot -p123456 --default-character-set=utf8 pmc2 < offers_us_qa_$ctime
cd /home/sean/sh
mysql -uroot -p123456 pmc2 < ./sqls/pmc2_import
-------------------------------------------------------------------------------------------
2.shell执行php脚本
#! /bin/sh
cd /var/www//szqa/
php5 sz_auto_export.php
-------------------------------------------------------------------------------------------
3.curl执行一个网页
curl http://rs3.etiwebhosting.com/pg/
-------------------------------------------------------------------------------------------
4.mysql数据库备份
#! /bin/sh
#backup the table:offers,pmc_logs--------------
mysqldump -uroot -p111111 --default-character-set=utf8 --opt pmc2 offers | gzip > /var/www//pmc/data/offers_bak_`date +%y%m%d`.gz;
-------------------------------------------------------------------------------------------