多机器同步rsync

2022/09/03 Tools 共 324 字,约 1 分钟

多机器同步rsync

tb () {
	x=$(pwd)
	echo $x
	rsync -avz --delete --exclude='build' $x/ ${DEV_A}:/home/${x:6}/
}

get () {
	x=$(pwd)
	echo $x
	rsync -avz --delete --exclude='' ${DEV_A}:/home/${x:6}/ $x/
}

检测文件变化可以

  • macOS: fswatch
  • Linux: ionotify

ssh可以远程执行另一台机器的命令

ssh ${DEV_A} "echo 'hhh'"

mac可以触发mac系统通知

osascript -e 'display notification "Notification text" with title "Title"'

Search

    Table of Contents