不在 rsync 输出中显示目录
有人知道是否有 rsync 选项,以便正在遍历的目录不会显示在标准输出上。
我正在同步音乐库,大量的目录使得很难看到哪些文件实际发生了变化。 我已经尝试过 -v 和 -i,但两者也显示目录。
Does anybody know if there is an rsync option, so that directories that are being traversed do not show on stdout.
I'm syncing music libraries, and the massive amount of directories make it very hard to see which file changes are actually happening.
I'v already tried -v and -i, but both also show directories.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在 rsync 命令中使用 --delete,则调用
grep -E -v '/$'
的问题是它将忽略如下信息行:如果您正在进行备份并且远程文件夹已因 X 原因被完全清除,它也会清除您的本地文件夹,因为您看不到删除行。
要忽略已存在的文件夹但同时保留删除行,您可以使用以下表达式:
If you're using --delete in your rsync command, the problem with calling
grep -E -v '/$'
is that it will omit the information lines like:If you're making a backup and the remote folder has been completely wiped out for X reason, it will also wipe out your local folder because you don't see the deleting lines.
To omit the already existing folder but keep the deleting lines at the same time, you can use this expression :
我很想通过管道通过 grep -E -v '/$' 进行过滤,它使用行尾锚来删除以斜杠(目录)结尾的行。
这是我检查过的演示终端会话......
I'd be tempted to filter using by piping through grep -E -v '/$' which uses an end of line anchor to remove lines which finish with a slash (a directory).
Here's the demo terminal session where I checked it...