Re: [PATCH v2 1/2] xattrs: Skip security.evm extended attribute
On Mon, Jan 9, 2017 at 2:31 PM, Stefan Bergerwrote: > GNU tar for example requires to use --xattrs-include=pattern to indicate > which extended attributes to put into the archive. It also support > --xattrs-exclude=pattern. Maybe something along those lines could work? > The latest git version now has a modifier to the filter options that lets you specify include/exclude rules that only apply to xattr names. These can be used to control what names get read from of the source files (sender-side rules) and what names get deleted from the destination files (receiver side rules). I've just done some simple testing, and it seems to work fine. ..wayne.. -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: downloading only specific directories from directory tree
The following URL may also be helpful in terms of another example : http://www.lbackup.org/developer/advanced_excludes_file_examples Hope that link is helpful. HTRAX 2013 Revitalised : EGYPTIAN HUMP HTRAX : Direct URL download : http://henri.shustak.org/download/htrax/egyptian-hump-htrax.mp3 "Dr Who Meets B52's" - More reviews : http://www.jessetaylor.com.au/htrax On 21/01/2017, at 12:15 PM, Kevin Korbwrote: > An include only overrides an exclude that follows it. So, you would > need something like this: > > + */ > + openSUSE_13.2/*** > - * > > Then add --prune-empty-dirs to your rsync command line. I left off the > initial ** because it doesn't really mean anything unless openSUSE_13.2 > isn't always the entire directory name in which case 1 * would do. > > Another way to explain it is that by default everything is included. An > exclude rule makes exceptions. An include rule makes exceptions to the > exclude rule. > > On 01/20/2017 06:08 PM, Istvan Gabor wrote: >> Hello: >> >> I have read rsync manual and several howtos on how to use rsync, still >> I don't know if it's doable what I want to do, and if yes, how. >> >> The scenario: >> >> I would like to make a local copy of openSUSE 13.2 repositories. >> I use openSUSE linux. >> >> The repos are located in a multi-level directory structure, eg: >> >> ftp://ftp.halifax.rwth-aachen.de/opensuse/repositories/ >> >> Let's call this directory the root dir. >> >> Each directory in the root has subdirectories, and one of the >> subdirectories >> is named "openSUSE_13.2". The openSUSE_13.2 dir can be one, two, or more >> level >> downstairs in the root dir, eg: >> >> http://download.opensuse.org/repositories/Apache/openSUSE_13.2/ >> http://download.opensuse.org/repositories/Apache:/MirrorBrain/openSUSE_13.2/ >> >> >> There are plenty of directories in the root dir, and each subdirectory can >> have several subdirectories. >> >> Is it possible, using rsync, to download only all "openSUSE_13.2" >> directories with >> their contents, without specifying directly one by one every subdirectory >> to be included or excluded? >> >> I tried to use filters.txt file with content: >> >> + **openSUSE_13.2/*** >> >> with this command: >> >> rsync -av --include-from=filters.txt >> rsync://ftp.halifax.rwth-aachen.de/opensuse/repositories/ ./ >> >> This downloads every directory. How can I exclude those are not >> openSUSE_13.2? >> >> Thanks, >> >> Istvan >> > > -- > ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., > Kevin Korb Phone:(407) 252-6853 > Systems Administrator Internet: > FutureQuest, Inc. ke...@futurequest.net (work) > Orlando, Floridak...@sanitarium.net (personal) > Web page: http://www.sanitarium.net/ > PGP public key available on web site. > ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: > https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
[SCM] The rsync repository. - branch master updated
The branch, master has been updated via 87bc224 Add a way to specify xattr name filtering. via a4e8b55 Join some lines. via 6265220 Get rid of some superfluous double-quotes in error messages. from 001adf5 Fix extern of preallocated_len w/o SUPPORT_PREALLOCATION. https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log - commit 87bc2240115a2a1beadd098518a17719908da2cb Author: Wayne DavisonDate: Sun Jan 22 16:01:45 2017 -0800 Add a way to specify xattr name filtering. commit a4e8b552d6a99373ef1c8cdb075568e755b5f402 Author: Wayne Davison Date: Sun Jan 22 15:44:18 2017 -0800 Join some lines. commit 62652202c46897b8fbce205834c626260e6b9855 Author: Wayne Davison Date: Sun Jan 22 15:42:36 2017 -0800 Get rid of some superfluous double-quotes in error messages. --- Summary of changes: exclude.c | 53 ++- flist.c | 33 +++- rsync.h | 5 rsync.yo | 28 ++--- testsuite/xattrs.test | 14 ++- xattrs.c | 69 ++- 6 files changed, 124 insertions(+), 78 deletions(-) Changeset truncated at 500 lines: diff --git a/exclude.c b/exclude.c index 0aaa19b..00988a7 100644 --- a/exclude.c +++ b/exclude.c @@ -44,6 +44,8 @@ filter_rule_list filter_list = { .debug_type = "" }; filter_rule_list cvs_filter_list = { .debug_type = " [global CVS]" }; filter_rule_list daemon_filter_list = { .debug_type = " [daemon]" }; +int saw_xattr_filter = 0; + /* Need room enough for ":MODS " prefix plus some room to grow. */ #define MAX_RULE_PREFIX (16) @@ -622,7 +624,7 @@ void change_local_filter_dir(const char *dname, int dlen, int dir_depth) filt_array[cur_depth] = push_local_filters(dname, dlen); } -static int rule_matches(const char *fname, filter_rule *ex, int name_is_dir) +static int rule_matches(const char *fname, filter_rule *ex, int name_flags) { int slash_handling, str_cnt = 0, anchored_match = 0; int ret_match = ex->rflags & FILTRULE_NEGATE ? 0 : 1; @@ -633,6 +635,9 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_is_dir) if (!*name) return 0; + if (!(name_flags & NAME_IS_XATTR) ^ !(ex->rflags & FILTRULE_XATTR)) + return 0; + if (!ex->u.slash_cnt && !(ex->rflags & FILTRULE_WILD2)) { /* If the pattern does not have any slashes AND it does * not have a "**" (which could match a slash), then we @@ -650,7 +655,7 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_is_dir) strings[str_cnt++] = "/"; } strings[str_cnt++] = name; - if (name_is_dir) { + if (name_flags & NAME_IS_DIR) { /* Allow a trailing "/"+"***" to match the directory. */ if (ex->rflags & FILTRULE_WILD3_SUFFIX) strings[str_cnt++] = "/"; @@ -702,7 +707,7 @@ static int rule_matches(const char *fname, filter_rule *ex, int name_is_dir) static void report_filter_result(enum logcode code, char const *name, filter_rule const *ent, -int name_is_dir, const char *type) +int name_flags, const char *type) { /* If a trailing slash is present to match only directories, * then it is stripped out by add_rule(). So as a special @@ -712,17 +717,40 @@ static void report_filter_result(enum logcode code, char const *name, static char *actions[2][2] = { {"show", "hid"}, {"risk", "protect"} }; const char *w = who_am_i(); + const char *t = name_flags & NAME_IS_XATTR ? "xattr" + : name_flags & NAME_IS_DIR ? "directory" + : "file"; rprintf(code, "[%s] %sing %s %s because of pattern %s%s%s\n", w, actions[*w!='s'][!(ent->rflags & FILTRULE_INCLUDE)], - name_is_dir ? "directory" : "file", name, ent->pattern, + t, name, ent->pattern, ent->rflags & FILTRULE_DIRECTORY ? "/" : "", type); } } +/* This function is used to check if a file should be included/excluded + * from the list of files based on its name and type etc. The value of + * filter_level is set to either SERVER_FILTERS or ALL_FILTERS. */ +int name_is_excluded(const char *fname, int name_flags, int filter_level) +{ + if (daemon_filter_list.head && check_filter(_filter_list, FLOG, fname, name_flags) < 0) { + if (!(name_flags & NAME_IS_XATTR)) + errno = ENOENT;
Re: downloading only specific directories from directory tree
On Fri, 20 Jan 2017 18:15:00 -0500, Kevin Korb wrote: An include only overrides an exclude that follows it. So, you would need something like this: + */ + openSUSE_13.2/*** - * Then add --prune-empty-dirs to your rsync command line. I left off the initial ** because it doesn't really mean anything unless openSUSE_13.2 isn't always the entire directory name in which case 1 * would do. Another way to explain it is that by default everything is included. An exclude rule makes exceptions. An include rule makes exceptions to the exclude rule. Thank you a lot. This worked the way I wanted. Istvan -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
[Bug 2294] Detect renamed files and handle by renaming instead of delete/re-send
https://bugzilla.samba.org/show_bug.cgi?id=2294 --- Comment #27 from Wolfgang Hamann--- Hi, I recently ran into the problem that a large file set got renamed and then re-sent. I tried to fix after the fact, so I went the obvious way of comparing sizes and modtimes on the destination and calculate checksums for potential matches. I would have preferred to use a list of inode numbers and files for the old and new file sets instead... So I wonder whether a different approach to the problem could make sense: a) the filelist contains inode numbers, and after a successful rsync, a file is generated in the target dir listing inodes and names of all files transferred b) when receiving to the same dir, if a target file does not exist, the inode in the filelist is used to look up the previous filename. If it exists and matches in size and modtime, it could be hardlinked. Deleting files from the target that are no longer in the source would take care of the old file. When the sync is completed without error, the list of inodes and file names would be updated c) when receiving in link-dest mode, the file in the old dir would be consulted for a potential match, and the new list would be created in the target dir Of course this only makes sense if inode numbers are reliable, as on all standard local file systems or nfs. I do not know whether the new storage arenas preserve inodes. It is obvious that the same inode may appear more than once in a source file set Regards Wolfgang -- You are receiving this mail because: You are the QA Contact for the bug. -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html