自動同步伺服器vm檔案的shell指令碼

2021-06-05 20:52:13 字數 570 閱讀 4175

#!/bin/sh

if [ $# -lt 1 ]; then

echo "[failed]please input project name."

else

if [ -d /home/admin/work/$1 ]; then

cd /home/admin/work/$1

svn up > files

find -name "files" -exec grep ".vm" {} \;|while read line

doif [ -z "$line" ]; then

continue

fiecho "find template changed : $line"

f="/home/admin/work/$/$"

cp $f $t

done

echo "[success]syn is ok."

else

echo "[failed] '$1' is not a project folder."

fifi

exit 0

主從伺服器實現檔案自動同步

示例 有三颱伺服器 第一步 分別配置好ssh免登陸 1 主 192.168.199.230 2 從 192.168.199.183 192.168.199.105 全域性資訊 uid root gid root log file var log rsyncd.log wwwroot 檔案目錄 pat...

伺服器檔案同步

假設我們要把本地檔案上傳到伺服器 這裡的伺服器是以centos為作業系統的 或者把a伺服器的檔案傳到b伺服器,要怎麼操作呢?或者要在伺服器間實時的同步檔案,要怎麼操作呢?把檔案上傳到伺服器。實現通過ftp軟體上傳,這個就很簡單了把,就是安裝好這類軟體,如xsftp bitvise ssh等 通過sh...

Linux 自動同步伺服器時間

linux伺服器執行久時,系統時間就會存在一定的誤差,怎樣使伺服器的時間和網路伺服器的時間同步。網路時間伺服器 首先得確保這些伺服器都能ping通否則是無法時間同步的。cp y usr share zoneinfo asia shanghai etc localtime zone asia shan...