- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在我的本地机器上我有几个插件,在服务器上我也有几个。
本地机器:
~/wp-content/plugins/plugin1~/wp-content/plugins/plugin1/includes~/wp-content/plugins/plugin2~/wp-content/plugins/plugin3~/wp-content/plugins/plugin4~/wp-content/plugins/plugin5
远程机器:
~/wp-content/plugins/plugin1~/wp-content/plugins/plugin1/includes~/wp-content/plugins/plugin3~/wp-content/plugins/plugin5
我可以使用什么 rsync 命令来更新远程目录中的所有文件,但前提是它们存在?为此,我想让 plugin1、plugin1/includes、plugin3 和 plugin5 同步——所有文件和目录都在里面——但不是 plugin2 或 plugin4。基本上,使用单个 rsync 命令更新所有插件(如果存在)。
最佳答案
仅用一个 rsync 命令不可能完全做到这一点。如果您只想更新 远程文件,但不想添加新 文件,您可以使用此命令:
rsync -rP --existing source/ user@remote:target/
这根本不会创建新文件或目录,但会更新不同的文件或目录。
编辑:也许你可以做这样的事情(假设 GNU find,如果 BSD/OS X:用 depth 替换 maxdepth):
#!/bin/bash
REMOTE_TARGET_DIR=/some/path
REMOTE_DIRS=$(ssh user@remote "find $REMOTE_TARGET_DIR -maxdepth 1 -type d -printf '%P\n' | sed 1d"
for DIR in $REMOTE_DIRS
do
rsync -rP "$DIR" "user@remote:$REMOTE_TARGET_DIR/"
done
警告:我还没有对此进行测试,您可能需要将“-n”添加到 rsync(空运行)以查看会发生什么。
关于linux - rsync 仅存在的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7000102/
当我使用 --progress 标志运行 rsync 时,我得到有关传输的信息,如下所示。 path/to/file 16 100% 0.01kB/s 0:00:01
为了使用单个 rsync 命令将两个源目录(例如 ~/src1 和 ~/src2)同步到远程系统中的两个独立目标(例如/tgt 和/tgt/sub_tgt),我正在做: rsync ~/src1 ui
从 rsync 手册文档中,我看到通过使用选项 rsync-path,可以指定要在远程计算机上运行的程序以启动 rsync。特别是,该程序可以是一个包装脚本,它在中间调用实际的 rsync 命令,但它
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我在远程主机上有一些文件(在目录中),我想在目录级别以原子方式执行 rsync 以在本地主机上提取文件(在分布式设置中)。我能想到的一种方法是一种非常简单的情况,我可以在本地主机上进行文件备份,然后用
我们有一个 130GB 大小的文件夹,其中包含数百万个微小 (5-20k) 图像文件,我们需要将它从旧服务器 (EC2) 移动到新服务器(德国 Hetzner)。 我们的 SQL 文件 SCP 很快就
我想知道是否有一种方法(命令)可以用来查找 rsync 地址的大小,而无需开始同步? 例如,我如何找到 rsync://mirrors.standaloneinstaller.com/vim/ 的大小
我想同步/Volumes/B/中的所有内容,除了我想全局排除的缓存目录。另外,我不想 rsync 任何其他/Volume/ 我有以下排除文件: + /Volumes/B/*** - Cache/ -
rsync -av --size-only --include="*/" --include="*.jpeg" --exclude="*" ~/alg/temperature/ ~/alg/tmp/
我正在使用 rsync 同步文件夹,如果现有文件已被修改,则对其进行备份。目前所有修改过的文件都备份到一个单独的目录中,以同步时间为后缀。这是使用以下命令: rsync --times --backu
我希望 rsync 排除所有包含具有特定名称的文件的目录,比如“.rsync-exclude”,独立于“.rsync-exclude”文件的内容。 如果文件“.rsync-exclude”只包含“*”
例子: rsync /tmp/fol1/fol2/fol3/foln user@addr:/tmp/fol1/fol2/fol3/foln 我的主要问题是文件夹/tmp/fol1 在远程机器上不存在。
以下命令按预期工作... cp -ur /home/abc/* /mnt/windowsabc/ rsync 相比它有什么优势吗?有没有更好的方法让备份文件夹每 24 小时保持同步? 最佳答案 Rsy
我想从本地计算机到服务器rsync。在不存在的目录上,我希望 rsync 首先在服务器上创建该目录。 我怎样才能做到这一点? 最佳答案 如果要创建的叶目录不止最后一个,您可以先运行单独的 ssh ..
我使用 rsync 来更新我的静态网站。我目前cd到本地网站目录,运行rsync命令,然后在下一行输入密码。我已将我的 rsync 调用保存到一个文本片段中(这样 _rs 就可以扩展到我的调用)。有没
我正在运行如下命令: rsync -vuan "/Volumes/Working/foldername/" "/Volumes/Archive/foldername/" 当文件夹名称包含“/”(如“1
我尝试使用以下命令从服务器进行 rsync,并收到以下错误消息: rsync -e ssh -avz name@home.com:/home/name/. . receiving file list
所以我有这个代码: rsync \ --archive \ --verbose \ --compress \ --delete \ --no-motd \ --ex
我使用 rsync 来更新我的静态网站。我目前cd到本地网站目录,运行rsync命令,然后在下一行输入密码。我已将我的 rsync 调用保存到一个文本片段中(这样 _rs 就可以扩展到我的调用)。有没
我正在运行如下命令: rsync -vuan "/Volumes/Working/foldername/" "/Volumes/Archive/foldername/" 当文件夹名称包含“/”(如“1
我是一名优秀的程序员,十分优秀!