rsync-排除不排除特定文件 [英] rsync --exclude not excluding specific files

查看:70
本文介绍了rsync-排除不排除特定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在运行rsync命令来备份我的特定文件夹.

I am currently running an rsync command to backup my specific folder.

这是命令:

rsync -rtzv -e --exclude "generator/" --exclude "workspace/gallery/server/lib/personas_constants.php"  /home/brandon/workspace/gallery /home/brandon/workspace/gallery2

我遇到的问题是--exclude不排除特定文件.这是我从中运行rsync命令的文件的相对路径.但是,排除对于"generator/"目录有效.

The issue I am having is the --exclude is not excluding the specific files. It is the relative path to the files from where I am running the rsync command. The exclude does however work for the "generator/" directory.

有人可以帮我照耀一下吗?

Can someone shine some light on this for me?

推荐答案

事实证明,这是来自正在彼此同步的文件夹的相对路径.并非从运行rsync命令的地方开始.

It turned out that it is the relative path from the folders that are being rsync'd with one another. Not from where you are running the rsync command.

--exclude "generator/" --exclude "server/lib/personas_constants.php" --exclude "server/lib/connect.php" 

解决了我的问题.

这篇关于rsync-排除不排除特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆