bash - 使用 fswatch 和 rsync 自动同步目录时找不到文件
问题描述
我正在使用 fswatch 和 rsync 在 Mac 和 ubuntu 服务器之间自动同步目录。外壳就像
/Users/david/Documents/code/shell/fswatch_rsync.sh:
#!/bin/bash
sudo fswatch -o /Users/david/Documents/code/python/ | xargs -n1 /Users/david/Documents/code/shell/rsync_shell.sh
/Users/david/Documents/code/shell/rsync_shell.sh:
sudo rsync -vzrp --delete /Users/david/Documents/code/python/ --password-file=/etc/rsyncd.pass -e "ssh -i /Users/david/.ssh/id_rsa -p 22" 192.168.0.109::python
但是,当我bash /Users/david/Documents/code/shell/fswatch_rsync.sh
在终端中运行并更改中的文件时/Users/david/Documents/code/python/
,它会响应:
xargs: /Users/david/Documents/code/shell/rsync_shell.sh: No such file or directory
在终端。
解决方案
推荐阅读
- node.js - 如何使用基于唯一id的节点更新mongodb中的多个文档
- php - 将我们当前的产品同步到 xero api 限制问题
- html - 样式内联问题
- c# - 删除之间的区别
EF 中的 () 和 WillCascadeOnDelete(false) - javascript - “IF textTrue ELSE textFalse”的正则表达式
- php - 如何解决 laravel php artisan 迁移错误问题?
- java - 没有易失性示例的破碎单例
- php - 未使用 wp_remote_post() 发送 XML 请求
- flutter - 自定义小部件不显示
- r - 自动化测试 R 函数调用