rsync 동기화 파일 스크립트

3075 단어
#/bin/bash

cd /root/phone

echo "update guanwang phone version"

git pull

if [ $? -ne 0 ]; then
        echo "update guanwang phone version from git failed"
        exit 1
fi

rsync -avzP --delete /root/phone *.*.*.*:/data/website/company/

if [ $? -ne 0 ]; then
        echo "rsync phone dir failed"
        exit 1
fi

echo "phone update success"

cd /root/web

echo "update guanwang web version"

git pull

if [ $? -ne 0 ]; then
        echo "update guanwang web version from git failed"
        exit 1
fi

rsync -avzP --delete /root/web *.*.*.*:/data/website/company/

if [ $? -ne 0 ]; then
        echo "rsync web dir failed"
        exit 1
fi

echo "web update success"

좋은 웹페이지 즐겨찾기