More efficient way to find & tar millions of files
Here's a find-tar combination that can do what you want without the use of xargs or exec (which should result in a noticeable speed-up):
tar --version # tar (GNU tar) 1.14 # FreeBSD find (on Mac OS X)find -x data -name "filepattern-*2009*" -print0 | tar --null --no-recursion -uf 2009.tar --files-from -# for GNU find use -xdev instead of -xgfind data -xdev -name "filepattern-*2009*" -print0 | tar --null --no-recursion -uf 2009.tar --files-from -# added: set permissions via tarfind -x data -name "filepattern-*2009*" -print0 | \ tar --null --no-recursion --owner=... --group=... --mode=... -uf 2009.tar --files-from -