柳暗花明笔记

    自用的自动部署小工具

    所属分类:[ linux&mysql ] 猫哲学家 发表于:2015-12-24 12:08 浏览:641

    #!/bin/sh

    tip='get-test,get-qas';

    echo $tip;


    if [ "$1" = "get-test" ] ; then
    pass="123456"
    host="192.168.9.103"
    from1="/home/wwwroot/www.moviemyshare.com/application/classes"
    from2="/home/wwwroot/www.moviemyshare.com/application/views"
    todir="/home/www/www.moviemyshare.com/application"
    for loop in $from1 $from2
    do
        echo 'Sending '$loop 'to' $host:$todir;
        sshpass -p $pass scp -r $loop root@$host:$todir;
    done
    fi


    if [ "$1" = "get-qas" ] ; then
    pass="123456"
    host="192.168.9.103"
    from1="/home/wwwroot/www.moviemyshare.com/application/classes"
    from2="/home/wwwroot/www.moviemyshare.com/application/views"
    todir="/opt/www/www.moviemyshare.com/application"
    for loop in $from1 $from2
    do
        echo 'Sending '$loop 'to' $host:$todir;
        sshpass -p $pass scp -P 6022 -r $loop root@$host:$todir;
    done
    fi

     

    保存为autoSendCode.sh,然后给执行权限 chmod +x

    标签: linux 
    上一编文章 kohana DB 增删改查速查 下一编文章 gz压缩与解压,从数据库自动备份了解到
    最近文章
    发表评论