I want to use --min-size to copy just large files (and their necessary parent directories), but everything I've tried copies *all* the source directories, and creates them empty on the destination even if they don't have any big files in them. I only want the minimal directory hierarchies that contain the big files. This doesn't work: $ rm -rf /tmp/foo $ rsync -ai --min-size 10M --prune-empty-dirs /home/idallen/test /tmp/foo cd+++++++++ test/ cd+++++++++ test/dir1/ cd+++++++++ test/dir2/ cd+++++++++ test/dir3/ cd+++++++++ test/dir4/ >f+++++++++ test/dir4/BIGFILE cd+++++++++ test/dir5/ >f+++++++++ test/dir5/BIGFILE cd+++++++++ test/dir6/ >f+++++++++ test/dir6/BIGFILE Wrong. I don't want all those dir1, dir2, dir3 empty directories. I don't want *any* empty directories, at any level. What am I missing? -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Open Source / Linux) via: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/
> From:?"Ian! D. Allen" <idallen@idallen.ca> > To:?rsync@lists.samba.org > Date:?Wed, 22 Apr 2009 02:20:37 -0400 > Subject:?purge-empty-dirs and max-file-size confusion > I want to use --min-size to copy just large files (and their necessary > parent directories), but everything I've tried copies *all* the source > directories, and creates them empty on the destination even if they > don't have any big files in them. ?I only want the minimal directory > hierarchies that contain the big files. ?This doesn't work: > > ? ?$ rm -rf /tmp/foo > ? ?$ rsync -ai --min-size 10M --prune-empty-dirs /home/idallen/test /tmp/foo > ? ?cd+++++++++ test/ > ? ?cd+++++++++ test/dir1/ > ? ?cd+++++++++ test/dir2/ > ? ?cd+++++++++ test/dir3/ > ? ?cd+++++++++ test/dir4/ > ? ?>f+++++++++ test/dir4/BIGFILE > ? ?cd+++++++++ test/dir5/ > ? ?>f+++++++++ test/dir5/BIGFILE > ? ?cd+++++++++ test/dir6/ > ? ?>f+++++++++ test/dir6/BIGFILE > > Wrong. ?I don't want all those dir1, dir2, dir3 empty directories. > I don't want *any* empty directories, at any level. > What am I missing?Have you tried --no-dirs? Felipe
On Wed, Apr 22, 2009 at 02:20:37AM -0400, Ian! D. Allen wrote:> I want to use --min-size to copy just large files (and their necessary > parent directories), but everything I've tried copies *all* the source > directories, and creates them empty on the destination even if they > don't have any big files in them. I only want the minimal directory > hierarchies that contain the big files.This is because --min-size is a transfer rule, not an exclude rule. An exclude rule would affect deletions, and --min-size just affects what is transferred out of the full set of files that are present. Thus, the dirs with smaller files are not actually empty, they just don't have any files that match the transfer rule. There is not currently a way include/exclude files based on size in rsync. ..wayne..