在rsync中使用--cvs-exclude突然忽略核心文件夹?

Zac*_*ler 12 rsync

我在rsync脚本上使用--cvs-exclude选项已经有一年多的时间了.我使用SVN存储库,因此它使SVN文件不能生产.

今天我尝试rsync更改,突然rsync没有从名为"core"的文件夹中提取任何内容.经过调查,我发现"core"是一个CVS文件夹,因此被忽略了.

所以我的问题是为什么rsync对我有用,但突然今天决定开始忽略它应该是的"核心"文件夹.

我通过简单地忽略SVN文件而不是使用CVS排除来解决了这个问题,但是为什么rsync工作到今天仍然感到困惑.

我的旧rsync代码:

rsync -vcaz --no-p --cvs-exclude --exclude downloader --exclude media --exclude var     /var/www/project/ user@production.com:/var/www/project/httpdocs/ | grep -v '/$'
Run Code Online (Sandbox Code Playgroud)

操作系统(运行Xubuntu):

Distributor ID: Ubuntu
Description:    Ubuntu 11.10
Release:    11.10
Codename:   oneiric
Run Code Online (Sandbox Code Playgroud)

rsync版本:

rsync  version 3.0.8  protocol version 30
Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes
Run Code Online (Sandbox Code Playgroud)

也许不是一个关键问题,但它仍困扰着我.

bet*_*ido 20

我也遇到了同样的问题.如果使用-C选项,Rsync将排除以下类型的文件:

static char default_cvsignore[] =
    /* These default ignored items come from the CVS manual. */
    "RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS"
    " .make.state .nse_depinfo *~ #* .#* ,* _$* *$"
    " *.old *.bak *.BAK *.orig *.rej .del-*"
    " *.a *.olb *.o *.obj *.so *.exe"
    " *.Z *.elc *.ln core"
    /* The rest we added to suit ourself. */
    " .svn/ .git/ .hg/ .bzr/";
Run Code Online (Sandbox Code Playgroud)

"核心"文件是已终止程序的核心转储,因此通常您不希望复制这些文件.问题是你有一个名为"core"的目录.

解决方案是使用"--include"选项,或创建包含以下规则的过滤文件:

+ core

然后使用"--filter = filename".