- 论坛徽章:
- 0
|
blackold 发表于 2012-02-17 09:23 ![]()
回复 1# bigxu
不过,确实是这样。这是我的部分源码- cat bak_hosts | grep -v ^# | while read line
- do
- echo $($log_date)" $line start"
- # echo $line
- # var=$(echo $line | awk -F" " '{print $1,$2,$3}')
- # http://www.unix.com/shell-programming-scripting/38450-split-string-using-separetor.html
- set -- $line
- rhost=$1
- rpath=$2
- mysql_pass=$3
- bak_day=$4
- if [ $mysql_pass = "DEFAULT" ]; then
- mysql_pass=$mysql_default_pass
- fi
-
- # if "-" then do not bak mysql
- if [ $mysql_pass != "-" ]; then
- echo $($log_date)" ssh_export_mysql start"
- #ssh_export_mysql $rhost $rpath $mysql_pass
- echo $($log_date)" ssh_export_mysql end"
- fi
- echo $($log_date)" rsync_file start"
- #rsync_file $rhost $rpath
- echo $($log_date)" rsync_file end"
- echo $($log_date)" bak_file start"
- bak_file $rhost $rpath $mysql_pass $bak_day
- echo $($log_date)" bak_file end"
- echo $($log_date)"-------------------------- "
- done
复制代码 |
|