Index: flist.c =================================================================== RCS file: /cvsroot/rsync/flist.c,v retrieving revision 1.318 diff -u -r1.318 flist.c --- flist.c 19 Jan 2006 21:16:44 -0000 1.318 +++ flist.c 20 Jan 2006 21:57:52 -0000 @@ -806,8 +806,12 @@ * into a mount-point directory, not to avoid copying a symlinked * file if -L (or similar) was specified. */ if (one_file_system && st.st_dev != filesystem_dev - && S_ISDIR(st.st_mode)) - flags |= FLAG_MOUNT_POINT; + && S_ISDIR(st.st_mode)) { + if (one_file_system > 1) + return NULL; + else + flags |= FLAG_MOUNT_POINT; + } if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) return NULL; Index: options.c =================================================================== RCS file: /cvsroot/rsync/options.c,v retrieving revision 1.298 diff -u -r1.298 options.c --- options.c 20 Jan 2006 18:49:07 -0000 1.298 +++ options.c 20 Jan 2006 21:57:53 -0000 @@ -425,7 +425,7 @@ {"chmod", 0, POPT_ARG_STRING, &chmod_mode, 0, 0, 0 }, {"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 }, {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 }, - {"one-file-system", 'x', POPT_ARG_NONE, &one_file_system, 0, 0, 0 }, + {"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 }, {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 }, {"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, {"ignore-non-existing",0,POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 }, @@ -1000,6 +1000,10 @@ arg = sanitize_path(NULL, arg, NULL, 0); basis_dir[basis_dir_cnt++] = (char *)arg; break; + + case 'x': + one_file_system++; + break; default: /* A large opt value means that set_refuse_options() @@ -1461,6 +1465,8 @@ argstr[x++] = 'R'; if (one_file_system) argstr[x++] = 'x'; + if (one_file_system > 1) + argstr[x++] = 'x'; if (sparse_files) argstr[x++] = 'S'; if (do_compression) Index: rsync.yo =================================================================== RCS file: /cvsroot/rsync/rsync.yo,v retrieving revision 1.319 diff -u -r1.319 rsync.yo --- rsync.yo 20 Jan 2006 18:52:52 -0000 1.319 +++ rsync.yo 20 Jan 2006 21:57:56 -0000 @@ -730,9 +730,18 @@ filesystem. It doesn't seem to handle seeks over null regions correctly and ends up corrupting the files. -dit(bf(-x, --one-file-system)) This tells rsync not to cross filesystem -boundaries when recursing. This is useful for transferring the -contents of only one filesystem. +dit(bf(-x, --one-file-system)) This tells rsync not to recurse into directories on +other filesystems. When rsync encounters a directory on a different filesystem than +the top-level directory it is sending, it skips the directory's contents but sends the +directory itself (so you can mount a filesystem there on the destination). +Note that the attributes of the root directory of the mounted filesystem, not the +attributes of the underlying directory on which it is mounted, are sent. + +If this option appears twice or more, then rsync completely skips files and directories +that are not on the same filesystem as the top-level directory. + +In both modes, a file or directory on another filesystem reached via a symlink is +subject to exclusion even if the symlink itself is on the original filesystem. dit(bf(--existing, --ignore-non-existing)) This tells rsync to skip updating files that do not exist yet on the destination. If this option is